Skip to content

Commit 3861780

Browse files
authored
Merge pull request #266 from Cherisher/master
fix memory leak when alloc new data failed
2 parents 75b4a12 + e3529d6 commit 3861780

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/ngx_http_upsync_module.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,6 +3846,7 @@ ngx_http_client_recv(ngx_http_conf_client *client, char **data, int size)
38463846

38473847
*data = (char *) ngx_calloc(page_count * ngx_pagesize, ngx_cycle->log);
38483848
if (*data == NULL) {
3849+
ngx_free(tmp_data);
38493850
return NGX_ERROR;
38503851
}
38513852
ngx_memcpy(*data, tmp_data, recv_num - tmp_recv);

0 commit comments

Comments
 (0)