summaryrefslogtreecommitdiff
path: root/libs/ardour/linux_vst_support.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-03-23 00:46:12 +0100
committerRobin Gareus <robin@gareus.org>2014-03-23 00:46:12 +0100
commit89e63b4bce0fbbbdfe5c2685e929c0f46bbbf7ca (patch)
treee1be268c907d7855b107f9fb15f816a8651aad9e /libs/ardour/linux_vst_support.cc
parent167991ecebe30847f76c028bd501f49968271069 (diff)
fix some memory leaks
Diffstat (limited to 'libs/ardour/linux_vst_support.cc')
-rw-r--r--libs/ardour/linux_vst_support.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/ardour/linux_vst_support.cc b/libs/ardour/linux_vst_support.cc
index 9d36905f48..f34112e24b 100644
--- a/libs/ardour/linux_vst_support.cc
+++ b/libs/ardour/linux_vst_support.cc
@@ -112,7 +112,7 @@ vstfx_new ()
void* vstfx_load_vst_library(const char* path)
{
void* dll;
- char* full_path;
+ char* full_path = NULL;
char* envdup;
char* lxvst_path;
size_t len1;
@@ -160,6 +160,7 @@ void* vstfx_load_vst_library(const char* path)
vstfx_error ("\"%s\"", lxvst_path);
len1 = strlen(lxvst_path);
+ if (full_path) free(full_path);
full_path = (char*)malloc(len1 + 1 + len2 + 1);
memcpy(full_path, lxvst_path, len1);
full_path[len1] = '/';
@@ -180,7 +181,7 @@ void* vstfx_load_vst_library(const char* path)
}
/*Free the path*/
-
+ if (full_path) free(full_path);
free(envdup);
return dll;