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.
This commit is contained in:
parent
10f36f219c
commit
54508703b0
4
file.c
4
file.c
|
@ -4871,8 +4871,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