aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2021-05-23 17:56:18 -0700
committerGuy Harris <gharris@sonic.net>2021-05-23 17:56:18 -0700
commit976ccc9a00d5abd4f1e1a6041378f8cb1292b27e (patch)
treea8e6b4835d51cca2dbd5f060d9d6e5cd18ce2a0e
parent1bb64b7e0ca46442b3f3a65e4b99893674b3c287 (diff)
netscaler: plug a memory leak.
Free the read buffer if the first read fails.
-rw-r--r--wiretap/netscaler.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c
index 366ccfc5ab..eb393430ca 100644
--- a/wiretap/netscaler.c
+++ b/wiretap/netscaler.c
@@ -734,6 +734,7 @@ wtap_open_return_val nstrace_open(wtap *wth, int *err, gchar **err_info)
bytes_read = file_read(nstrace_buf, page_size, wth->fh);
if (bytes_read < 0 || bytes_read != page_size) {
*err = file_error(wth->fh, err_info);
+ g_free(nstrace_buf);
if (*err == 0 && bytes_read > 0)
return WTAP_OPEN_NOT_MINE;
return WTAP_OPEN_ERROR;