speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix possible memleak in spd_get_default_address in libspeechd.c


From: Halim Sahin
Subject: [PATCH] fix possible memleak in spd_get_default_address in libspeechd.c
Date: Wed, 6 Oct 2010 17:27:46 +0200

Fix memleak in spd_get_default_address funktion (libspeechd.c)

When the funktion can't get an useful address it simply sets the pointer
to NULL but does not free the allocated memory.

diff --git a/src/api/c/libspeechd.c b/src/api/c/libspeechd.c
index 53247ba..f7e3958 100644
--- a/src/api/c/libspeechd.c
+++ b/src/api/c/libspeechd.c
@@ -203,6 +203,7 @@ spd_get_default_address(char **error)
       }
     }else{ // Unknown or unsupported method requested
       *error = strdup("Unknown or unsupported communication method");
+      free(address);
       address = NULL;
     }
     g_strfreev(pa);
-- 
Halim Sahin
E-Mail:                         
halim.sahin (at) t-online.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]