allow err_info==NULL in file_error()
authorMartin Kaiser <wireshark@kaiser.cx>
Tue, 29 Oct 2013 09:15:02 +0000 (09:15 -0000)
committerMartin Kaiser <wireshark@kaiser.cx>
Tue, 29 Oct 2013 09:15:02 +0000 (09:15 -0000)
this fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9309
reported by Peter Wu

svn path=/trunk/; revision=52943

wiretap/file_wrappers.c

index 1a6492a0c401f03d5743a318d24ed75bd4002359..be7557d490faf2d328106bd13bb9bbc0cdaa53b9 100644 (file)
@@ -1316,7 +1316,8 @@ int
 file_error(FILE_T fh, gchar **err_info)
 {
        if (fh->err != 0) {
-               *err_info = (fh->err_info == NULL) ? NULL : g_strdup(fh->err_info);
+               if (err_info)
+                       *err_info = (fh->err_info == NULL) ? NULL : g_strdup(fh->err_info);
                return fh->err;
        }
        return 0;