From 6f2e317e1ed7907518d9fb5c8a85983075c32724 Mon Sep 17 00:00:00 2001 From: haipo yang Date: Thu, 23 Nov 2017 18:38:18 +0800 Subject: [PATCH] update --- marketprice/mp_message.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/marketprice/mp_message.c b/marketprice/mp_message.c index fe94a454..835fbd2f 100644 --- a/marketprice/mp_message.c +++ b/marketprice/mp_message.c @@ -351,12 +351,15 @@ static int init_market(void) if (dict_market == NULL) return -__LINE__; - json_t *r = send_market_list_req(); - if (r == NULL) - return -__LINE__; redisContext *context = redis_sentinel_connect_master(redis); if (context == NULL) return -__LINE__; + json_t *r = send_market_list_req(); + if (r == NULL) { + log_error("get market list fail"); + redisFree(context); + return -__LINE__; + } for (size_t i = 0; i < json_array_size(r); ++i) { json_t *item = json_array_get(r, i); const char *name = json_string_value(json_object_get(item, "name"));