Skip to content

Commit

Permalink
[fix] fix crash when parse sub appenders
Browse files Browse the repository at this point in the history
  • Loading branch information
shabicheng committed Mar 1, 2018
1 parent bccba43 commit 606557e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/log_producer_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ log_producer_config * _load_log_producer_config_JSON_Obj(cJSON * pJson, apr_pool
}
}

cJSON_Delete(pJson);

return producerConfig;
}

Expand All @@ -304,7 +302,9 @@ log_producer_config * load_log_producer_config_JSON(const char * jsonStr)
return NULL;
}

return _load_log_producer_config_JSON_Obj(pJson, NULL);
log_producer_config * producerConfig = _load_log_producer_config_JSON_Obj(pJson, NULL);
cJSON_Delete(pJson);
return producerConfig;
}

log_producer_config * log_producer_config_get_sub(log_producer_config * config, const char * sub_config)
Expand Down

0 comments on commit 606557e

Please sign in to comment.