diff mbox series

[v3,2/2] linux-gen: Added additional missing free

Message ID 1501786830-1874-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series None | expand

Commit Message

Github ODP bot Aug. 3, 2017, 7 p.m. UTC
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>


Added 2 additional missing frees in _odp_queue_pool_create() as requested
on review.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

---
/** Email created from pull request 101 (apalos:bug_3182)
 ** https://github.com/Linaro/odp/pull/101
 ** Patch: https://github.com/Linaro/odp/pull/101.patch
 ** Base sha: 4537d096721a753086592ed5a989beab5647bcfa
 ** Merge commit sha: 7bee8312cef61d52ce1c788583f3831f05afcfeb
 **/
 platform/linux-generic/odp_pkt_queue.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_pkt_queue.c b/platform/linux-generic/odp_pkt_queue.c
index 06420a96..f1086096 100644
--- a/platform/linux-generic/odp_pkt_queue.c
+++ b/platform/linux-generic/odp_pkt_queue.c
@@ -241,8 +241,11 @@  _odp_int_queue_pool_t _odp_queue_pool_create(uint32_t max_num_queues,
 	*/
 	initial_free_list_size = MIN(64 * 1024, max_queued_pkts / 4);
 	rc = pkt_queue_free_list_add(pool, initial_free_list_size);
-	if (rc < 0)
+	if (rc < 0) {
+		free(pool->queue_num_tbl);
+		free(pool);
 		return _ODP_INT_QUEUE_POOL_INVALID;
+	}
 
 	/* Discard the first queue blk with idx 0 */
 	queue_blk_alloc(pool, &first_queue_blk_idx);