[ofw] [PATCH] libdat v2.0: memory leak in static registration during parsing

Davis, Arlin R arlin.r.davis at intel.com
Mon Dec 6 16:22:50 PST 2010


the platform_params char string, allocated when parsing dat.conf, is not freed.

Signed-off-by: Arlin Davis <arlin.r.davis at intel.com>
---
 dat/udat/udat_sr_parser.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dat/udat/udat_sr_parser.c b/dat/udat/udat_sr_parser.c
index 3b5caef..1d5f0d8 100644
--- a/dat/udat/udat_sr_parser.c
+++ b/dat/udat/udat_sr_parser.c
@@ -492,6 +492,12 @@ DAT_RETURN dat_sr_parse_entry(DAT_OS_FILE * file)
 					    1));
 	}
 
+	if (NULL != entry.platform_params) {
+		dat_os_free(entry.platform_params,
+			    sizeof(char) *
+			    (dat_os_strlen(entry.platform_params) +  1));
+	}
+
 	return status;
 }
 
-- 
1.7.3






More information about the ofw mailing list