summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-06-06 02:24:49 +0200
committerRobin Gareus <robin@gareus.org>2013-06-06 02:24:49 +0200
commite9341a7de38a7edd7c70aedd17a53e8d91b293a1 (patch)
tree9b7294af701403f73932d111d7bf793ccce03353 /libs
parentcd8180c864f5d02d7ce0515ed9f5b2ff4f6e1901 (diff)
fix memory leaks and compiler warnings in LXVST code
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/linux_vst_info_file.cc13
-rw-r--r--libs/ardour/linux_vst_support.cc1
2 files changed, 10 insertions, 4 deletions
diff --git a/libs/ardour/linux_vst_info_file.cc b/libs/ardour/linux_vst_info_file.cc
index 7d4df1dcc8..581bcca87f 100644
--- a/libs/ardour/linux_vst_info_file.cc
+++ b/libs/ardour/linux_vst_info_file.cc
@@ -169,7 +169,7 @@ vstfx_infofile_path (char* dllpath, int personal)
}
} else {
- dir = Glib::path_get_dirname (dllpath);
+ dir = Glib::path_get_dirname (std::string(dllpath));
}
stringstream s;
@@ -214,6 +214,7 @@ vstfx_infofile_for_read (char* dllpath)
{
struct stat own_statbuf;
struct stat sys_statbuf;
+ FILE *rv = NULL;
char* own_info = vstfx_infofile_stat (dllpath, &own_statbuf, 1);
char* sys_info = vstfx_infofile_stat (dllpath, &sys_statbuf, 0);
@@ -222,14 +223,16 @@ vstfx_infofile_for_read (char* dllpath)
if (sys_info) {
if (own_statbuf.st_mtime <= sys_statbuf.st_mtime) {
/* system info file is newer, use it */
- return g_fopen (sys_info, "rb");
+ rv = g_fopen (sys_info, "rb");
}
} else {
- return g_fopen (own_info, "rb");
+ rv = g_fopen (own_info, "rb");
}
}
+ free(own_info);
+ free(sys_info);
- return 0;
+ return rv;
}
static FILE *
@@ -416,6 +419,8 @@ vstfx_free_info (VSTInfo *info)
free (info->name);
free (info->creator);
free (info->Category);
+ free (info->ParamNames);
+ free (info->ParamLabels);
free (info);
}
diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc
index 99251f08e4..1fccf79968 100644
--- a/libs/ardour/linux_vst_support.cc
+++ b/libs/ardour/linux_vst_support.cc
@@ -379,6 +379,7 @@ void vstfx_close (VSTState* vstfx)
dlclose(vstfx->handle->dll); //dlclose keeps its own reference count
vstfx->handle->dll = 0;
}
+ free(vstfx);
}