Skip to content

Commit

Permalink
Merge pull request #266 from Cherisher/master
Browse files Browse the repository at this point in the history
fix memory leak when alloc new data failed
  • Loading branch information
xiaokai-wang authored Oct 21, 2019
2 parents 75b4a12 + e3529d6 commit 3861780
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ngx_http_upsync_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -3846,6 +3846,7 @@ ngx_http_client_recv(ngx_http_conf_client *client, char **data, int size)

*data = (char *) ngx_calloc(page_count * ngx_pagesize, ngx_cycle->log);
if (*data == NULL) {
ngx_free(tmp_data);
return NGX_ERROR;
}
ngx_memcpy(*data, tmp_data, recv_num - tmp_recv);
Expand Down

0 comments on commit 3861780

Please sign in to comment.