[WGID-265479,265481] Add null check 61/141761/2 accepted/tizen_3.0_common accepted/tizen_3.0_mobile accepted/tizen_3.0_wearable tizen_3.0 accepted/tizen/3.0/common/20170803.140638 accepted/tizen/3.0/mobile/20170803.011112 accepted/tizen/3.0/wearable/20170803.011159 submit/tizen_3.0/20170802.052417
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 1 Aug 2017 09:57:04 +0000 (18:57 +0900)
committerseonah moon <seonah1.moon@samsung.com>
Tue, 1 Aug 2017 09:58:52 +0000 (09:58 +0000)
Change-Id: Ib04370ac8b686fd267623571d6df9a8ede76a63e
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
src/http_transaction.c

index ce075a30f6584ae2f330a2727203546a31235549..d9f22c21d5662b93a7ce6562239b96dff4a3ca49 100644 (file)
@@ -545,7 +545,8 @@ API int http_session_open_transaction(http_session_h http_session, http_method_e
        /* Header */
        transaction->header->rsp_header_len = 0;
        transaction->header->rsp_header = malloc(transaction->header->rsp_header_len + 1);
-       transaction->header->rsp_header[0] = '\0';
+       if (transaction->header->rsp_header)
+               transaction->header->rsp_header[0] = '\0';
        transaction->header->header_list = NULL;
        transaction->header->hash_table = NULL;
        transaction->header_event = FALSE;
@@ -1207,7 +1208,8 @@ API int http_transaction_open_authentication(http_transaction_h http_transaction
 
        auth_transaction->header->rsp_header_len = 0;
        auth_transaction->header->rsp_header = malloc(auth_transaction->header->rsp_header_len + 1);
-       auth_transaction->header->rsp_header[0] = '\0';
+       if (auth_transaction->header->rsp_header)
+               auth_transaction->header->rsp_header[0] = '\0';
        auth_transaction->header_event = FALSE;
 
        if (transaction->request->host_uri)