[ovs-dev] [PATCH 07/10] util: set_program_name() can be called twice with different names.

Gurucharan Shetty shettyg at nicira.com
Tue May 13 16:03:21 UTC 2014


Ex: ovstest.c

Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>
---
 lib/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/util.c b/lib/util.c
index 769558e..74dc889 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -461,7 +461,7 @@ set_program_name__(const char *argv0, const char *version, const char *date,
     SetErrorMode(GetErrorMode() | SEM_NOGPFAULTERRORBOX);
 
     if (program_name) {
-        return;
+        free(program_name);
     }
     basename = xmalloc(max_len);
     _splitpath_s(argv0, NULL, 0, NULL, 0, basename, max_len, NULL, 0);
-- 
1.7.9.5




More information about the dev mailing list