Update SDB to fix last covs

This commit is contained in:
pancake 2018-10-13 13:25:05 +02:00
parent b66374d937
commit c4795fc766
2 changed files with 7 additions and 7 deletions

View File

@ -299,9 +299,6 @@ SDB_API void ht_foreach(SdbHt *ht, HtForeachCallback cb, void *user) {
SdbListIter *iter, *tmp;
for (i = 0; i < ht->size; i++) {
ls_foreach_safe (ht->table[i], iter, tmp, kv) {
if (!kv) {
continue;
}
if (!cb (user, kv->key, kv->value)) {
return;
}

View File

@ -1,4 +1,4 @@
/* sdb - MIT - Copyright 2011-2017 - pancake */
/* sdb - MIT - Copyright 2011-2018 - pancake */
#include <stdio.h>
#include <fcntl.h>
@ -296,6 +296,7 @@ SDB_API int sdb_uncat(Sdb *s, const char *key, const char *value, ut32 cas) {
char *p, *v = sdb_get_len (s, key, &vlen, NULL);
int mod = 0;
if (!v || !key || !value) {
free (v);
return 0;
}
valen = strlen (value);
@ -512,9 +513,11 @@ SDB_API SdbKv* sdbkv_new2(const char *k, int kl, const char *v, int vl) {
}
SDB_API void sdbkv_free(SdbKv *kv) {
free (sdbkv_key (kv));
free (sdbkv_value (kv));
R_FREE (kv);
if (kv) {
free (sdbkv_key (kv));
free (sdbkv_value (kv));
R_FREE (kv);
}
}
static ut32 sdb_set_internal(Sdb* s, const char *key, char *val, int owned, ut32 cas) {