]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/fty_regex.c
ncurses 6.0 - patch 20160604
[ncurses.git] / form / fty_regex.c
index 7a42e7eee7f00b8d6b2c24a346b73606b2c8c0f8..194a52e8a1290043fef37b6b53e0f1411006f119 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2015 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fty_regex.c,v 1.25 2012/10/27 20:12:53 tom Exp $")
+MODULE_ID("$Id: fty_regex.c,v 1.26 2015/01/10 17:10:25 tom Exp $")
 
 #if HAVE_REGEX_H_FUNCS         /* We prefer POSIX regex */
 #include <regex.h>
@@ -113,7 +113,7 @@ Generic_RegularExpression_Type(void *arg MAYBE_UNUSED)
 
   if (rx)
     {
-      preg = typeMalloc(RegExp_Arg, 1);
+      preg = typeCalloc(RegExp_Arg, 1);
 
       if (preg)
        {
@@ -264,6 +264,7 @@ Free_RegularExpression_Type(void *argp MAYBE_UNUSED)
            {
              free(ap->refCount);
              regfree(ap->pRegExp);
+             free(ap->pRegExp);
            }
 #elif HAVE_REGEXP_H_FUNCS | HAVE_REGEXPR_H_FUNCS
          if (ap->compiled_expression)