diff options
author | rbuj <[email protected]> | 2020-02-01 15:02:10 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-03-12 15:09:58 +0100 |
commit | b759b715dd2a8dd1f8fb61bfdc7b196151ea8a22 (patch) | |
tree | 4b266617fd4aa937441356a1ea21c875b3c5ed91 /sendto | |
parent | fe3c3c71c0d1b88f64abd6d833c3e2d2af9b3665 (diff) | |
download | caja-extensions-b759b715dd2a8dd1f8fb61bfdc7b196151ea8a22.tar.bz2 caja-extensions-b759b715dd2a8dd1f8fb61bfdc7b196151ea8a22.tar.xz |
caja-sendto-command: fix memory leak pointed to by 'p'
Diffstat (limited to 'sendto')
-rw-r--r-- | sendto/caja-sendto-command.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sendto/caja-sendto-command.c b/sendto/caja-sendto-command.c index 1ede360..9b90041 100644 --- a/sendto/caja-sendto-command.c +++ b/sendto/caja-sendto-command.c @@ -638,21 +638,27 @@ caja_sendto_plugin_dir_process (const char *plugindir) } else { while ((item = g_dir_read_name(dir))) { if (g_str_has_suffix (item, SOEXT)) { - char *module_path; + g_autofree gchar *module_path = NULL; p = g_new0(NstPlugin, 1); + module_path = g_module_build_path (plugindir, item); + if (!module_path) { + g_free (p); + continue; + } + p->module = g_module_open (module_path, 0); if (!p->module) { g_warning ("error opening %s: %s", module_path, g_module_error ()); - g_free (module_path); + g_free (p); continue; } - g_free (module_path); if (!g_module_symbol (p->module, "nst_init_plugin", (gpointer *) &nst_init_plugin)) { g_warning ("error: %s", g_module_error ()); g_module_close (p->module); + g_free (p); continue; } |