netscaler: plug a memory leak.

Free the read buffer if the first read fails.


(cherry picked from commit 976ccc9a00)
This commit is contained in:
Guy Harris 2021-05-23 17:56:18 -07:00
parent 7c969e2deb
commit ac7673bd0a
1 changed files with 1 additions and 0 deletions

View File

@ -716,6 +716,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;