Possible fix?
>From b6cea36a762f7532873c5e1e35fc29564398f7e4 Mon Sep 17 00:00:00 2001
From: Fabian Holler <fabian.hol...@profitbricks.com>
Date: Mon, 25 Nov 2013 12:57:23 +0100
Subject: [PATCH] readproc: fix src_buffer and dst_buffer memory leaks

Jinpu Wang discovered that src_buffer and dst_buffer area allocated in
the openproc(..) function but never freed.
This commit fixes it by freeing the memory in the closeproc(..)
function.
---
 proc/readproc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/proc/readproc.c b/proc/readproc.c
index e772298..6974baa 100644
--- a/proc/readproc.c
+++ b/proc/readproc.c
@@ -1199,6 +1199,11 @@ void closeproc(PROCTAB* PT) {
         memset(PT,'#',sizeof(PROCTAB));
         free(PT);
     }
+
+    free(src_buffer);
+    src_buffer = NULL;
+    free(dst_buffer);
+    dst_buffer = NULL;
 }

 // deallocate space allocated by readproc
-- 
1.7.2.5


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to