diff options
author | Guy Harris <gharris@sonic.net> | 2021-05-22 12:23:50 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2021-05-22 12:23:50 -0700 |
commit | 54508703b0ac4d85df4104f6114a247d68c42b8e (patch) | |
tree | 2156fff928aa3a181409a56b5549a6311f52ff8a /file.c | |
parent | 10f36f219c46342af6399ea6e0d8106910b3e8f0 (diff) |
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.
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |