[vlc-commits] url: fix leak

Rémi Denis-Courmont git at videolan.org
Fri Apr 24 20:14:46 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Apr 24 21:14:31 2015 +0300| [a1264cb75e64e3250c448756c5063a4603155104] | committer: Rémi Denis-Courmont

url: fix leak

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a1264cb75e64e3250c448756c5063a4603155104
---

 src/test/url.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/test/url.c b/src/test/url.c
index b976cb8..d024180 100644
--- a/src/test/url.c
+++ b/src/test/url.c
@@ -80,11 +80,12 @@ static inline void test_path (const char *in, const char *out)
 
 static inline void test_current_directory_path (const char *in, const char *cwd, const char *out)
 {
-    char * expected_result = NULL;
-    int val = asprintf(&expected_result, "file://%s/%s", cwd, out);
+    char *expected_result;
+    int val = asprintf (&expected_result, "file://%s/%s", cwd, out);
     assert (val != -1);
 
     test (make_URI_def, in, expected_result);
+    free(expected_result);
 }
 
 static void test_url_parse(const char* in, const char* protocol, const char* user,



More information about the vlc-commits mailing list