summaryrefslogtreecommitdiffstats
path: root/src/utils/dictionary.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/dictionary.c')
-rwxr-xr-xsrc/utils/dictionary.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/utils/dictionary.c b/src/utils/dictionary.c
index cba7ae3..a488c9c 100755
--- a/src/utils/dictionary.c
+++ b/src/utils/dictionary.c
@@ -76,6 +76,7 @@ void put(struct dictionary * d, char * k, char * v) {
//if ( ! strlen (k) ) return;
struct nlist * nl;
+ char * cl;
// Insert the first element
if (d->list == NULL) {
@@ -91,7 +92,7 @@ void put(struct dictionary * d, char * k, char * v) {
// Duplicated keys are not allowed.
// If an existent key is inserted, the value is overwritten.
- } else if ( get(d, k) != '\0' ) {
+ } else if ( (cl = get(d, k)) != NULL && cl[0] != '\0' ) {
nl = get_nl(d, k);
free(nl->val);