Browse Source

Add -fsanitize=address to DEBUG compile options.

scossu 10 hours ago
parent
commit
a2bf2380d0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      Makefile
  2. 1 1
      src/store_mdb.c

+ 1 - 1
Makefile

@@ -40,7 +40,7 @@ INCLUDE := -I$(INCLUDE_BASE)
 
 _CFLAGS = -std=c11 -Wall -Wextra -fPIC $(INCLUDE)
 CFLAGS = $(if $(DEBUG),\
-		 $(_CFLAGS) -Itest -O0 -ggdb -DDEBUG,\
+		 $(_CFLAGS) -Itest -O0 -fsanitize=address -ggdb -DDEBUG,\
 		 $(_CFLAGS) -O3 -g0)
 
 #$(info CFLAGS: $(CFLAGS))

+ 1 - 1
src/store_mdb.c

@@ -887,8 +887,8 @@ mdbiter_next (
 static void
 mdbiter_free (void *h)
 {
+    if (!h) return;
     MDBIterator *it = h;
-    if (!it) return;
 
     if (it->cur) mdb_cursor_close (it->cur);
     if (it->ctx_cur) mdb_cursor_close (it->ctx_cur);