修复内存泄露

This commit is contained in:
zhangchengwei
2018-12-14 19:26:31 +08:00
committed by zhengchao
parent d24c57ce85
commit 1059af3c72
3 changed files with 29 additions and 8 deletions

View File

@@ -214,7 +214,7 @@ void tango_cache_ctx_destroy(struct tango_cache_ctx *ctx, bool callback)
case CACHE_REQUEST_PUT:
if(ctx->put.uploadID != NULL) free(ctx->put.uploadID);
if(ctx->put.combine_xml != NULL) free(ctx->put.combine_xml);
if(ctx->put.object_meta == NULL) cJSON_Delete(ctx->put.object_meta);
if(ctx->put.object_meta != NULL) cJSON_Delete(ctx->put.object_meta);
if(ctx->put.evbuf!=NULL)
{
ctx->instance->statistic.memory_used -= evbuffer_get_length(ctx->put.evbuf);