SHA256
1
0
forked from pool/openvswitch
openvswitch/0001-python-c-ext-Fix-memory-leak-in-Parser_finish.patch
Tomáš Chvátal 9d0b2cf8f2 Accepting request 651988 from home:jaicaa:branches:network
- Backport upstream fix for python json parser memory leak (bsc#1116437)
 * 0001-python-c-ext-Fix-memory-leak-in-Parser_finish.patch

OBS-URL: https://build.opensuse.org/request/show/651988
OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=167
2018-11-26 14:07:00 +00:00

29 lines
808 B
Diff

From e120ff1f8e4dbb0b889b26e0be082376a32090bc Mon Sep 17 00:00:00 2001
From: Eric Lapointe <elapointe@corsa.com>
Date: Wed, 31 Oct 2018 12:11:42 -0400
Subject: [PATCH] python-c-ext: Fix memory leak in Parser_finish
The memory returned by json_parser_finish needs to be freed by the caller.
Signed-off-by: Eric Lapointe <elapointe@corsa.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
---
python/ovs/_json.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/python/ovs/_json.c b/python/ovs/_json.c
index 8b8402025..ef7bb4b8e 100644
--- a/python/ovs/_json.c
+++ b/python/ovs/_json.c
@@ -170,6 +170,7 @@ Parser_finish(json_ParserObject * self)
json = json_parser_finish(self->_parser);
self->_parser = NULL;
obj = json_to_python(json);
+ json_destroy(json);
return obj;
}
--
2.16.4