drop mem_alloc and mem_free, use my own hand crafted optmized macros that
[apps/madmutt.git] / lib / rx.c
index e7c4f3c..772fa8d 100644 (file)
--- a/lib/rx.c
+++ b/lib/rx.c
@@ -8,16 +8,18 @@
 #include "config.h"
 #endif
 
+#include <lib-lib/mem.h>
+
 #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 = mem_calloc (1, sizeof (rx_t));
 
   pp->pattern = str_dup (s);
-  pp->rx = safe_calloc (1, sizeof (regex_t));
+  pp->rx = mem_calloc (1, sizeof (regex_t));
   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) {