Skip to content

Commit

Permalink
Merge pull request #39 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 22, 2019
2 parents 16566e3 + 74630f8 commit 80dfbc3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/ngx_stream_upsync_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -3669,6 +3669,7 @@ ngx_stream_client_recv(ngx_stream_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 80dfbc3

Please sign in to comment.