Hi,

On 17.05.2014 16:58, Willy Tarreau wrote:
> Hi Thomas,
>
> On Sat, May 17, 2014 at 03:12:40PM +0200, Thomas Heil wrote:
>> The patch works. No crashes anymore. Thanks a lot,
> Thanks for confirming, however the fix is still not good (regfree
> may only be called with a non-null pointer, and still needs free()
> to be run afterwards). Could you please check with this one instead :
>
>       free(errmsg);
> -     free(preg);
> +     if (preg) {
> +             regfree(preg);
> +             free(preg);
> +     }
Ive tried with this patch
-b
Index: haproxy-1.5-dev25/src/cfgparse.c
===================================================================
--- haproxy-1.5-dev25.orig/src/cfgparse.c
+++ haproxy-1.5-dev25/src/cfgparse.c
@@ -1580,7 +1580,10 @@ static int create_cond_regex_rule(const

  err:
        free(errmsg);
-       free(preg);
+       if (preg) {
+               regfree(preg);
+               free(preg);
+       }      
        return err_code;
 }
--

but this leads to a segmentation fault.  I wonder why nobody else runs
in that issue.

> Thanks,
> Willy
>
>
thanks
thomas


Reply via email to