PATCH: small corrections to storage/overdata.c and nnrpd/nnrpd.h

Chris Caputo ccaputo at alt.net
Fri Jun 17 02:25:25 UTC 2005


Hi.  Two small patches...

overdata.c:  On success, the overview.fmt file was being left open and the 
"schema" variable was not freed.  Corrected those two things and also made 
it so the "list" variable is freed on failure.

nnrpd.h:  Remove unneeded extern for ARTreadschema().  nnrpd doesn't 
call that anymore.

Thanks,
Chris

--- inn-2.4.2-stock/storage/overdata.c  2004-12-22 04:21:19.000000000 +0000
+++ inn-2.4.2/storage/overdata.c        2005-06-17 02:15:47.427268608 +0000
@@ -56,7 +56,8 @@
  struct vector *
  overview_extra_fields(void)
  {
-    struct vector *list;
+    struct vector *list = NULL;
+    struct vector *ret = NULL;
      char *schema = NULL;
      char *line, *p;
      QIOSTATE *qp = NULL;
@@ -104,14 +105,16 @@
              syswarn("error while reading %s", schema);
          }
      }
-    return list;
+    ret = list;

   fail:
      if (schema != NULL)
          free(schema);
      if (qp != NULL)
          QIOclose(qp);
-    return NULL;
+    if (NULL == ret && NULL != list)
+        vector_free(list);
+    return ret;
  }
--- inn-2.4.2-stock/nnrpd/nnrpd.h       2004-12-22 04:21:19.000000000 +0000
+++ inn-2.4.2/nnrpd/nnrpd.h     2005-06-17 02:17:54.582760624 +0000
@@ -216,7 +220,6 @@
  extern const char      *ARTpost(char *article, char *idbuff, bool ihave,
                          bool *permanent);
  extern void            ARTclose(void);
-extern bool            ARTreadschema(void);
  extern int             TrimSpaces(char *line);
  extern char            *Glom(char **av);
  extern int             Argify(char *line, char ***argvp);


More information about the inn-workers mailing list