xinetd/sconf.c-fix-possible-memleak.patch
2019-09-30 11:20:12 -04:00

29 lines
754 B
Diff

From 2df8f29306ea5d9d96f9c7a2313ae04cbdd1f54c Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Thu, 24 May 2012 08:43:22 +0200
Subject: [PATCH 11/16] sconf.c: fix possible memleak
---
xinetd/sconf.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/xinetd/sconf.c b/xinetd/sconf.c
index 71b6a30..c874d24 100644
--- a/xinetd/sconf.c
+++ b/xinetd/sconf.c
@@ -153,6 +153,11 @@ struct service_config *sc_make_special( const char *service_name,
if ( SC_ID(scp) == NULL )
{
out_of_memory( func ) ;
+ /*
+ * Since we're returning instead of exiting, it's probably a good idea to
+ * free scp
+ */
+ sc_free( scp );
return( NULL ) ;
}
SC_SPECIFY( scp, A_ID ) ;
--
2.19.1