diff options
-rw-r--r-- | src/http_transaction.c | 6 |
1 files changed, 4 insertions, 2 deletions
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) |