netutils/webclient: fix location of argument check
authorJihun Ahn <jhun.ahn@samsung.com>
Mon, 15 May 2017 04:05:22 +0000 (13:05 +0900)
committerEunBong Song <eunb.song@samsung.com>
Tue, 11 Jul 2017 11:11:15 +0000 (20:11 +0900)
This commit fixes check the argument field location.

Change-Id: I076de6721857cb4bbdcb4401f981794666ba7c78
Signed-off-by: Jihun Ahn <jhun.ahn@samsung.com>
apps/netutils/webclient/webclient.c

index fc82880..0827045 100644 (file)
@@ -1295,6 +1295,10 @@ int http_client_send_request(struct http_client_request_t *request,
        struct http_client_ssl_config_t *ssl_conf = ssl_config;
 #endif
 
+       if (response == NULL) {
+               printf("Error: Response is null\n");
+               return -1;
+       }
        if (request == NULL) {
                printf("Error: Request is null\n");
                return -1;
@@ -1309,10 +1313,6 @@ int http_client_send_request(struct http_client_request_t *request,
                request->tls = false;
                request->response = response;
        }
-       if (response == NULL) {
-               printf("Error: Response is null\n");
-               goto errout;
-       }
        if (request->url == NULL) {
                printf("Error: URL is NULL!!\n");
                goto errout;