Free up the err_info string returned by wtap_read() and

wtap_seek_read().

Clean up indentation.

svn path=/trunk/; revision=25400
This commit is contained in:
Guy Harris 2008-05-30 02:44:02 +00:00
parent 07263e1a17
commit be161ba460
3 changed files with 6 additions and 2 deletions

View File

@ -167,6 +167,7 @@ process_cap_file(wtap *wth, const char *filename)
case WTAP_ERR_UNSUPPORTED_ENCAP:
case WTAP_ERR_BAD_RECORD:
fprintf(stderr, "(%s)\n", err_info);
g_free(err_info);
break;
}
return 1;

View File

@ -814,6 +814,7 @@ main(int argc, char *argv[])
case WTAP_ERR_UNSUPPORTED_ENCAP:
case WTAP_ERR_BAD_RECORD:
fprintf(stderr, "(%s)\n", err_info);
g_free(err_info);
break;
}
}

6
file.c
View File

@ -3794,15 +3794,17 @@ cf_read_error_message(int err, const gchar *err_info)
switch (err) {
case WTAP_ERR_UNSUPPORTED_ENCAP:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"The file \"%%s\" has a packet with a network type that Wireshark doesn't support.\n(%s)",
err_info);
break;
g_free(err_info);
break;
case WTAP_ERR_BAD_RECORD:
g_snprintf(errmsg_errno, sizeof(errmsg_errno),
"An error occurred while reading from the file \"%%s\": %s.\n(%s)",
wtap_strerror(err), err_info);
g_free(err_info);
break;
default: