From 275b80b81746cdf5fc9b8299e7441c9d0d8718de Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Wed, 20 Nov 2019 18:06:01 +0100 Subject: [HICN-404] double-free in facemgr (facemgr_list_facelets_json) + valgrind fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id57873d3f4152af654f3bc27778d7015495597d7 Signed-off-by: Jordan Augé --- ctrl/libhicnctrl/src/api.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ctrl/libhicnctrl') diff --git a/ctrl/libhicnctrl/src/api.c b/ctrl/libhicnctrl/src/api.c index 1a5bd8cee..2d8ee40f0 100644 --- a/ctrl/libhicnctrl/src/api.c +++ b/ctrl/libhicnctrl/src/api.c @@ -521,6 +521,8 @@ hc_sock_free(hc_sock_t * s) } else { for (unsigned i = 0; i < n; i++) { hc_sock_request_t * request = request_array[i]; + if (hc_sock_map_remove(s->map, request->seq, NULL) < 0) + ERROR("[hc_sock_process] Error removing request from map"); hc_sock_request_free(request); } free(request_array); @@ -669,6 +671,8 @@ hc_sock_process(hc_sock_t * s, hc_data_t ** data) if (s->remaining == 0) { hc_data_set_complete(request->data); *data = request->data; + if (hc_sock_map_remove(s->map, request->seq, NULL) < 0) + ERROR("[hc_sock_process] Error removing request from map"); hc_sock_request_free(request); } else { /* We only remember it if there is still data to parse */ -- cgit 1.2.3-korg