From 0e2a690e97d24e24229729fe26fbc6e6b7a62404 Mon Sep 17 00:00:00 2001 From: kanoi Date: Tue, 27 Jan 2015 09:32:16 +1100 Subject: [PATCH] ckdb - remove compile warning --- src/ckdb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ckdb.c b/src/ckdb.c index 341cc4e4..3b197309 100644 --- a/src/ckdb.c +++ b/src/ckdb.c @@ -1240,7 +1240,7 @@ static enum cmd_values breakdown(K_TREE **trf_root, K_STORE **trf_store, char reply[1024] = ""; TRANSFER *transfer; K_TREE_CTX ctx[1]; - K_ITEM *item; + K_ITEM *item = NULL; char *cmdptr, *idptr, *next, *eq, *end, *was; char *data = NULL, *tmp; bool noid = false; @@ -1462,9 +1462,11 @@ static enum cmd_values breakdown(K_TREE **trf_root, K_STORE **trf_store, JSON_END, tmp = safe_text(next)); free(tmp); free(cmdptr); - K_WLOCK(transfer_free); - k_add_head(transfer_free, item); - K_WUNLOCK(transfer_free); + if (item) { + K_WLOCK(transfer_free); + k_add_head(transfer_free, item); + K_WUNLOCK(transfer_free); + } return CMD_REPLY; } } else {