Skip to content

Commit 80dfbc3

Browse files
authored
Merge pull request #39 from Cherisher/master
fix memory leak when alloc new data failed
2 parents 16566e3 + 74630f8 commit 80dfbc3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ngx_stream_upsync_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,6 +3669,7 @@ ngx_stream_client_recv(ngx_stream_conf_client *client, char **data, int size)
36693669

36703670
*data = (char *) ngx_calloc(page_count * ngx_pagesize, ngx_cycle->log);
36713671
if (*data == NULL) {
3672+
ngx_free(tmp_data);
36723673
return NGX_ERROR;
36733674
}
36743675
ngx_memcpy(*data, tmp_data, recv_num - tmp_recv);

0 commit comments

Comments
 (0)