From 706b74a15b49f9f1a721ab8a602b602c7f1e5e96 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Sat, 8 Oct 2022 08:08:30 +0200 Subject: [PATCH] bugfix: check for 0 before free_ref --- src/runtime/c/pgf/pgf.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runtime/c/pgf/pgf.cxx b/src/runtime/c/pgf/pgf.cxx index 8b9a7c56c..000a136b0 100644 --- a/src/runtime/c/pgf/pgf.cxx +++ b/src/runtime/c/pgf/pgf.cxx @@ -615,7 +615,8 @@ PgfExpr pgf_read_expr(PgfText *input, PgfUnmarshaller *u) PgfExprParser parser(input, u); PgfExpr res = parser.parse_expr(); if (!parser.eof()) { - u->free_ref(res); + if (res != 0) + u->free_ref(res); return 0; } return res;