From: Seonah Moon Date: Tue, 1 Aug 2017 09:57:04 +0000 (+0900) Subject: [WGID-265479,265481] Add null check X-Git-Tag: submit/tizen_3.0/20170802.052417^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_3.0;p=platform%2Fcore%2Fapi%2Fhttp.git [WGID-265479,265481] Add null check Change-Id: Ib04370ac8b686fd267623571d6df9a8ede76a63e Signed-off-by: Seonah Moon --- diff --git a/src/http_transaction.c b/src/http_transaction.c index ce075a3..d9f22c2 100644 --- a/src/http_transaction.c +++ b/src/http_transaction.c @@ -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)