forked from osmocom/wireshark
Plug a memory leak.
If the user aborted the process of exporting packets, if we're writing
to a temporary file, we unlink the file, but we don't free the
g_mallocated name of the file, so it's leaked. Free it.
(cherry picked from commit 54508703b0
)
This commit is contained in:
parent
d072335658
commit
93e794c373
4
file.c
4
file.c
|
@ -4877,8 +4877,10 @@ cf_export_specified_packets(capture_file *cf, const char *fname,
|
|||
XXX - should we do so even if we're not writing to a
|
||||
temporary file? */
|
||||
wtap_dump_close(pdh, &err, &err_info);
|
||||
if (fname_new != NULL)
|
||||
if (fname_new != NULL) {
|
||||
ws_unlink(fname_new);
|
||||
g_free(fname_new);
|
||||
}
|
||||
return CF_WRITE_ABORTED;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue