Projects
Eulaceura:Mainline:GA
yajl
_service:obs_scm:0005-yajl-2.1.0-fix-memory-lea...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0005-yajl-2.1.0-fix-memory-leak.patch of Package yajl
From abc2d23fbc250a859dd0430a74fba2e5c3c28d5b Mon Sep 17 00:00:00 2001 From: wujing <wujing50@huawei.com> Date: Thu, 14 Feb 2019 03:12:30 +0800 Subject: [PATCH] yajl: fix memory leak problem reason: fix memory leak problem diff --git a/src/yajl_tree.c b/src/yajl_tree.c index 3d357a3..4b3cf2b 100644 --- a/src/yajl_tree.c +++ b/src/yajl_tree.c @@ -143,7 +143,7 @@ static yajl_val context_pop(context_t *ctx) ctx->stack = stack->next; v = stack->value; - + free (stack->key); free (stack); return (v); @@ -444,6 +444,10 @@ yajl_val yajl_tree_parse (const char *input, snprintf(error_buffer, error_buffer_size, "%s", internal_err_str); YA_FREE(&(handle->alloc), internal_err_str); } + while(ctx.stack != NULL) { + yajl_val v = context_pop(&ctx); + yajl_tree_free(v); + } yajl_free (handle); return NULL; }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2