Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
settings: fix memory leak in hts_settings_save()
  • Loading branch information
perexg committed Feb 14, 2016
1 parent 727b15c commit 4ce7a93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/settings.c
Expand Up @@ -182,12 +182,14 @@ hts_settings_save(htsmsg_t *record, const char *pathfmt, ...)
htsbuf_queue_flush(&hq);
} else {
#if ENABLE_ZLIB
msgdata = NULL;
r = htsmsg_binary_serialize(record, &msgdata, &msglen, 0x10000);
if (!r && msglen >= 4) {
r = tvh_gzip_deflate_fd_header(fd, msgdata + 4, msglen - 4, 3);
if (r)
ok = 0;
}
free(msgdata);
#endif
}
close(fd);
Expand Down

0 comments on commit 4ce7a93

Please sign in to comment.