From 27ca0db7a6143d2e479ff1ae52ec7c349ab1d4f2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 7 Jan 2014 23:33:46 +0100 Subject: util/Alloc: new library replacing GLib's g_malloc() --- src/Directory.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Directory.cxx') 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; } -- cgit v1.2.3