History

hcom: fix double free on writing zero-length file

Mans Rullgard committed 11 years ago

Commit 998208f1 parent 1968a7f1 file · +3 −2Browse files

Unified · Split

src/hcom.c+3−2
@@ -445,9 +445,10 @@ static int stopwrite(sox_format_t * ft) · 444 unmodified lines
445445 int rc = SOX_SUCCESS;
446446
447447 /* Compress it all at once */
448− if (compressed_len)
448+ if (compressed_len) {
449449 compress(ft, &compressed_data, (int32_t *)&compressed_len);
450− free(p->data);
450+ free(p->data);
451+ }
451452
452453 /* Write the header */
453454 lsx_writebuf(ft, "\000\001A", (size_t) 3); /* Dummy file name "A" */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t