test/x11comp: fix memory leak
authorRan Benita <ran234@gmail.com>
Sun, 13 Mar 2016 20:56:48 +0000 (22:56 +0200)
committerRan Benita <ran234@gmail.com>
Sun, 13 Mar 2016 21:17:23 +0000 (23:17 +0200)
Signed-off-by: Ran Benita <ran234@gmail.com>
test/x11comp.c

index bf5bbe7d5b7d0db4b085afd12a350bd4853fd22d..6df861acb133ead66f0c355fa14bdf6c460aaf55 100644 (file)
@@ -50,7 +50,7 @@ main(void)
                              NULL };
     pid_t xkbcomp_pid;
 
-    char *xhost;
+    char *xhost = NULL;
     int xdpy_current;
     int xdpy_candidate;
 
@@ -88,6 +88,7 @@ main(void)
             break;
         }
     }
+    free(xhost);
     if (ret != 0) {
         ret = SKIP_TEST;
         goto err_ctx;