[mkbundle] Don't free bundled dylibrary directory (#3897)
authorAleksey Kliger (λgeek) <akliger@gmail.com>
Sat, 5 Nov 2016 01:02:23 +0000 (21:02 -0400)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 5 Nov 2016 01:02:23 +0000 (21:02 -0400)
mkdtemp modifies the template in-place, don't free it.

mono/mini/main.c

index 80044897a83e48a34caee27a8aa05d1a92e74edc..77f8bc9578c9cea42168c5695dd3dca43d53ff6c 100644 (file)
@@ -151,7 +151,7 @@ bundle_save_library_initialize ()
        bundle_save_library_initialized = 1;
        char *path = g_build_filename (g_get_tmp_dir (), "mono-bundle-XXXXXX", NULL);
        bundled_dylibrary_directory = g_mkdtemp (path);
-       g_free (path);
+       /* don't free path - mkdtemp modifies it in place, and bundled_dylibrary_directory is an alias of it */
        if (bundled_dylibrary_directory == NULL)
                return;
        atexit (delete_bundled_libraries);