Fix a NULL pointer deference.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 7 Feb 2000 12:52:51 +0000 (12:52 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 7 Feb 2000 12:52:51 +0000 (12:52 +0000)
buffy.c

diff --git a/buffy.c b/buffy.c
index 981c4d9375c1db54f29ed760a3c709a9791f4cce..2ae0bbeee58fd9263f7ea64dd4c451d7aa1f91fd 100644 (file)
--- a/buffy.c
+++ b/buffy.c
@@ -118,9 +118,11 @@ int test_new_folder (const char *path)
   if (typ != M_MBOX && typ != M_MMDF && typ != M_KENDRA)
     return 0;
 
-  f = fopen (path, "rb");
-  rc = test_last_status_new (f);
-  fclose (f);
+  if ((f = fopen (path, "rb")))
+  {
+    rc = test_last_status_new (f);
+    fclose (f);
+  }
 
   return rc;
 }