netscaler: plug a memory leak.

Free the read buffer if the first read fails.
This commit is contained in:
Guy Harris 2021-05-23 17:56:18 -07:00
parent 1bb64b7e0c
commit 976ccc9a00
1 changed files with 1 additions and 0 deletions

View File

@ -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;