diff options
author | Robin Gareus <robin@gareus.org> | 2014-04-14 15:21:29 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2014-04-14 15:21:29 +0200 |
commit | 09d5d7f26b3778c22806366ef97223b193eaa65b (patch) | |
tree | fa671db49a637169ee7d489c66f93d035eddda9c /libs/fst | |
parent | 15c5d12321c16932a00b849e25226e0c02bbef82 (diff) |
remove code intended for use with basename(), fix memory leak since g_path_get_basename() returns a newly allocated string.
Diffstat (limited to 'libs/fst')
-rw-r--r-- | libs/fst/vstwin.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libs/fst/vstwin.c b/libs/fst/vstwin.c index 6537918a7f..a55d4e59aa 100644 --- a/libs/fst/vstwin.c +++ b/libs/fst/vstwin.c @@ -8,7 +8,6 @@ #include <pthread.h> static UINT_PTR idle_timer_id = 0; -//extern char* basename(char *path); // #else /* linux + wine */ @@ -490,9 +489,8 @@ fst_load (const char *path) if ((strlen(path)) && (NULL != (fhandle = fst_handle_new ()))) { char* period; - fhandle->nameptr = strdup (path); fhandle->path = strdup (path); - fhandle->name = strdup (g_path_get_basename(fhandle->nameptr)); + fhandle->name = g_path_get_basename(path); if ((period = strrchr (fhandle->name, '.'))) { *period = '\0'; } @@ -541,9 +539,8 @@ fst_unload (VSTHandle** fhandle) (*fhandle)->path = NULL; } - if ((*fhandle)->nameptr) { - free ((*fhandle)->nameptr); - (*fhandle)->nameptr = NULL; + if ((*fhandle)->name) { + free ((*fhandle)->name); (*fhandle)->name = NULL; } |