From d61a8e1bd8f66c21565debb468cb8a4f40258d14 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 8 Jan 2009 16:10:15 -0800 Subject: [PATCH] Fix memory leak in make_pidfile(). Found by Chris Eagle via Fortify. --- lib/daemon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/daemon.c b/lib/daemon.c index b8fc5afe..3f417d42 100644 --- a/lib/daemon.c +++ b/lib/daemon.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford +/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation @@ -178,6 +178,7 @@ make_pidfile(void) } else { /* Keep 'fd' open to retain the lock. */ } + free(text); } else { VLOG_ERR("%s: write failed: %s", tmpfile, strerror(errno)); close(fd); -- 2.30.2