allow err_info==NULL in file_error()
authormartink <martink@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 29 Oct 2013 09:15:02 +0000 (09:15 +0000)
committermartink <martink@f5534014-38df-0310-8fa8-9805f1628bb7>
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

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@52943 f5534014-38df-0310-8fa8-9805f1628bb7

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;