Skip to content

Commit

Permalink
Merge pull request #2043 from stephenprocter/master
Browse files Browse the repository at this point in the history
Problem: zhttp_response_recv leaks memory when result is non-zero
  • Loading branch information
sappo authored Jan 21, 2020
2 parents e90cf4b + dea544b commit d526e7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zhttp_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ zhttp_response_recv (zhttp_response_t *self, zhttp_client_t *client, void** arg_
self->free_content = self->content != NULL;

if (result != 0) {
zhash_destroy(&self->headers);
self->headers = zhash_new ();
zhash_autofree (self->headers);

Expand Down Expand Up @@ -247,4 +248,4 @@ zhttp_response_reset_content (zhttp_response_t *self) {
void
zhttp_response_test (bool verbose) {

}
}

0 comments on commit d526e7e

Please sign in to comment.