Code

Include strings.h instead of defining _BSD_SOURCE to get strcasecmp.
[sysdb.git] / src / core / object.c
index 9101918654379a1ff41491df64187d399468d186..dfa06551cb62c1353b59d827ea5333c8e7f30187 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <strings.h>
 
 /*
  * private types
@@ -149,6 +150,9 @@ sdb_object_deref(sdb_object_t *obj)
        if (obj->ref_cnt > 0)
                return;
 
+       /* we'd access free'd memory in case ref_cnt < 0 */
+       assert(! obj->ref_cnt);
+
        if (obj->type.destroy)
                obj->type.destroy(obj);