Update of /cvsroot/mahogany/M/lib/dspam
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32767

Modified Files:
        read_config.c 
Log Message:
fixed Windows compilation; don't leak memory when we failed to open config file

Index: read_config.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/dspam/read_config.c,v
retrieving revision 1.1.3.1
retrieving revision 1.2
diff -b -u -2 -r1.1.3.1 -r1.2
--- read_config.c       2 Oct 2004 13:15:21 -0000       1.1.3.1
+++ read_config.c       2 Oct 2004 16:24:35 -0000       1.2
@@ -26,5 +26,7 @@
 #include <errno.h>
 #include <stdlib.h>
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
+#endif
 #include <string.h>
 
@@ -51,10 +53,15 @@
 
   if (path == NULL)
-    file = fopen(CONFIG_DEFAULT, "r");
-  else
+    path = CONFIG_DEFAULT;
+  if (path == NULL) {
+    /* no default config file name */
+    return NULL;
+  }
+
     file = fopen(path, "r");
 
   if (file == NULL) {
     file_error (ERROR_FILE_OPEN, CONFIG_DEFAULT, strerror(errno));
+    free(attrib);
     return NULL;
   }



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to