diff options
author | Max Kellermann <max@duempel.org> | 2014-01-07 23:33:46 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-07 23:35:18 +0100 |
commit | 27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2 (patch) | |
tree | 3f200069ab73baa09898fe1f242c6fd85396e2ba /src/Directory.cxx | |
parent | 49f34fbf6861f10dbf9eb7549177888394926ff9 (diff) | |
download | mpd-27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2.tar.gz mpd-27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2.tar.xz mpd-27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2.zip |
util/Alloc: new library replacing GLib's g_malloc()
Diffstat (limited to 'src/Directory.cxx')
-rw-r--r-- | src/Directory.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Directory.cxx b/src/Directory.cxx index f9c1e2ba4..750fee896 100644 --- a/src/Directory.cxx +++ b/src/Directory.cxx @@ -174,7 +174,7 @@ Directory::LookupDirectory(const char *uri) if (isRootDirectory(uri)) return this; - char *duplicated = g_strdup(uri), *name = duplicated; + char *duplicated = xstrdup(uri), *name = duplicated; Directory *d = this; while (1) { @@ -194,7 +194,7 @@ Directory::LookupDirectory(const char *uri) name = slash + 1; } - g_free(duplicated); + free(duplicated); return d; } @@ -244,7 +244,7 @@ Directory::LookupSong(const char *uri) assert(holding_db_lock()); assert(uri != nullptr); - duplicated = g_strdup(uri); + duplicated = xstrdup(uri); base = strrchr(duplicated, '/'); Directory *d = this; @@ -252,7 +252,7 @@ Directory::LookupSong(const char *uri) *base++ = 0; d = d->LookupDirectory(duplicated); if (d == nullptr) { - g_free(duplicated); + free(duplicated); return nullptr; } } else @@ -261,7 +261,7 @@ Directory::LookupSong(const char *uri) Song *song = d->FindSong(base); assert(song == nullptr || song->parent == d); - g_free(duplicated); + free(duplicated); return song; } |