From: Ben Pfaff Date: Fri, 9 Jan 2009 00:10:15 +0000 (-0800) Subject: Fix memory leak in make_pidfile(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d61a8e1bd8f66c21565debb468cb8a4f40258d14;p=openvswitch Fix memory leak in make_pidfile(). Found by Chris Eagle via Fortify. --- 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);