Bump sdb from git (fix some memleaks)

This commit is contained in:
pancake 2014-03-19 03:17:28 +01:00
parent 85e9020155
commit 44a0774069
4 changed files with 10 additions and 8 deletions

View File

@ -119,6 +119,8 @@ static int dbdiff (const char *a, const char *b) {
}
sdb_free (A);
sdb_free (B);
free (k);
free (v);
return n;
}

View File

@ -123,6 +123,7 @@ next_quote:
*eq++ = 0;
if (bufset)
free (buf);
free (out);
return NULL;
}
next = strchr (quot, ';');
@ -138,6 +139,7 @@ next_quote:
s = sdb_ns (s, cmd);
if (!s) {
eprintf ("Cant find namespace %s\n", cmd);
free (out);
return NULL;
}
cmd = arroba+1;
@ -222,7 +224,7 @@ next_quote:
}
}
}
return buf;
out_concat (buf);
} else if (*cmd == '[') {
// [?] - count elements of array
if (cmd[1]=='?') {

View File

@ -0,0 +1 @@
#define SDB_VERSION "0.8.0.rc3"

View File

@ -334,14 +334,11 @@ SDB_API int sdb_foreach (Sdb* s, SdbForeachCallback cb, void *user) {
if (!cb (user, kv->key, kv->value))
return 0;
} else {
if (!cb (user, k, v)) {
free (k);
free (v);
return 0;
}
int ret = cb (user, k, v);
free (k);
free (v);
if (!ret) return 0;
}
free (k);
free (v);
}
ls_foreach (s->ht->list, iter, kv) {
if (!kv->value || !*kv->value)