diff --git a/devel/libyajl/Makefile b/devel/libyajl/Makefile index d3306ea860cc..09d2d6199f11 100644 --- a/devel/libyajl/Makefile +++ b/devel/libyajl/Makefile @@ -4,6 +4,7 @@ GH_ACCOUNT = lloyd GH_PROJECT = yajl GH_TAGNAME = 2.1.0 PKGNAME = lib${DISTNAME} +REVISION = 0 CATEGORIES = devel diff --git a/devel/libyajl/patches/patch-src_yajl_tree_c b/devel/libyajl/patches/patch-src_yajl_tree_c new file mode 100644 index 000000000000..02d2fc7e7d2d --- /dev/null +++ b/devel/libyajl/patches/patch-src_yajl_tree_c @@ -0,0 +1,31 @@ +Plug leaks. From upstream + +https://github.com/lloyd/yajl/issues/250#issuecomment-1628695214 +https://github.com/likema/yajl/commit/31531a6e6b5641398237ce15b7e62da02d975fc6 + +Index: src/yajl_tree.c +--- src/yajl_tree.c.orig ++++ src/yajl_tree.c +@@ -144,6 +144,7 @@ static yajl_val context_pop(context_t *ctx) + + v = stack->value; + ++ free (stack->key); + free (stack); + + return (v); +@@ -444,7 +445,14 @@ 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); ++ //If the requested memory is not released in time, it will cause memory leakage ++ if(ctx.root) ++ yajl_tree_free(ctx.root); + return NULL; + } + diff --git a/devel/libyajl/pkg/PLIST b/devel/libyajl/pkg/PLIST index 6aa50fea587b..ce8a2b03ee54 100644 --- a/devel/libyajl/pkg/PLIST +++ b/devel/libyajl/pkg/PLIST @@ -7,5 +7,5 @@ include/yajl/yajl_parse.h include/yajl/yajl_tree.h include/yajl/yajl_version.h @lib lib/libyajl.so.${LIByajl_VERSION} -lib/libyajl_s.a +@static-lib lib/libyajl_s.a share/pkgconfig/yajl.pc