X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frx.c;h=616d82452a4847277d40e71e15ff0ab76874d070;hb=49f1156410e9a037404101696d37b2c0d5c67564;hp=e7c4f3cc43aed8cab7a155e72baca9320959c33c;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d;p=apps%2Fmadmutt.git diff --git a/lib/rx.c b/lib/rx.c index e7c4f3c..616d824 100644 --- a/lib/rx.c +++ b/lib/rx.c @@ -8,16 +8,18 @@ #include "config.h" #endif +#include + #include "rx.h" #include "mem.h" #include "str.h" rx_t *rx_compile (const char *s, int flags) { - rx_t *pp = safe_calloc (1, sizeof (rx_t)); + rx_t *pp = p_new(rx_t, 1); pp->pattern = str_dup (s); - pp->rx = safe_calloc (1, sizeof (regex_t)); + pp->rx = p_new(regex_t, 1); if (REGCOMP(pp->rx, NONULL (s), flags) != 0) rx_free (&pp); @@ -25,10 +27,10 @@ rx_t *rx_compile (const char *s, int flags) { } void rx_free (rx_t** p) { - FREE(&(*p)->pattern); + p_delete(&(*p)->pattern); regfree ((*p)->rx); - FREE(&(*p)->rx); - FREE(p); + p_delete(&(*p)->rx); + p_delete(p); } int rx_compare (const rx_t* r1, const rx_t* r2) {