File 0028-sysctl-Fixing-memory-leaks-in-PreloadSystem.patch of Package procps.16210

From 8622b582da06fb93a8f06d302215269835fca9a9 Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Thu, 2 Jan 2014 19:49:36 +0100
Subject: [PATCH] sysctl: Fixing memory leaks in PreloadSystem()

---
 sysctl.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git sysctl.c sysctl.c
index 33c9403..51af15d 100644
--- sysctl.c
+++ sysctl.c
@@ -645,6 +645,13 @@ static int PreloadSystem(void)
 			printf(_("* Applying %s ...\n"), DEFAULT_PRELOAD);
 		rc |= Preload(DEFAULT_PRELOAD);
 	}
+
+	/* cleaning */
+	for (i = 0; i < ncfgs; ++i) {
+		free(cfgs[i]);
+	}
+	if (cfgs) free(cfgs);
+
 	return rc;
 }
 
-- 
1.7.9.2

openSUSE Build Service is sponsored by