mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
Update SDB to fix last covs
This commit is contained in:
parent
b66374d937
commit
c4795fc766
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user