Small fix to documentation.
[miniexpect.git] / miniexpect.c
index 8c1efd9..e1a184c 100644 (file)
 
 #include <pcre.h>
 
+/* RHEL 6 pcre did not define PCRE_PARTIAL_SOFT.  However PCRE_PARTIAL
+ * is a synonym so use that.
+ */
+#ifndef PCRE_PARTIAL_SOFT
+#define PCRE_PARTIAL_SOFT PCRE_PARTIAL
+#endif
+
 #include "miniexpect.h"
 
 #define DEBUG 0
@@ -107,6 +114,7 @@ mexp_spawnl (const char *file, const char *arg, ...)
     new_argv = realloc (argv, sizeof (char *) * (i+1));
     if (new_argv == NULL) {
       free (argv);
+      va_end (args);
       return NULL;
     }
     argv = new_argv;
@@ -115,6 +123,7 @@ mexp_spawnl (const char *file, const char *arg, ...)
 
   h = mexp_spawnv (file, argv);
   free (argv);
+  va_end (args);
   return h;
 }