aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-04 15:21:10 +0100
committerMax Kellermann <max@duempel.org>2013-12-04 15:21:10 +0100
commit02fcf184b5620c9ccbbc26024f9b0f341061a39a (patch)
treee280247f72056cbd0e093ba0e1b954319732bbf9
parentb978126bb0b22631306b095c7c6f4b2fdafe5557 (diff)
downloadmpd-02fcf184b5620c9ccbbc26024f9b0f341061a39a.tar.gz
mpd-02fcf184b5620c9ccbbc26024f9b0f341061a39a.tar.xz
mpd-02fcf184b5620c9ccbbc26024f9b0f341061a39a.zip
tag/ApeLoader: use new[]/delete[] instead of g_malloc()/g_free()
-rw-r--r--src/tag/ApeLoader.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tag/ApeLoader.cxx b/src/tag/ApeLoader.cxx
index 8251efe10..febe4467d 100644
--- a/src/tag/ApeLoader.cxx
+++ b/src/tag/ApeLoader.cxx
@@ -22,8 +22,6 @@
#include "system/ByteOrder.hxx"
#include "fs/FileSystem.hxx"
-#include <glib.h>
-
#include <stdint.h>
#include <assert.h>
#include <stdio.h>
@@ -61,9 +59,9 @@ ape_scan_internal(FILE *fp, ApeTagCallback callback)
remaining -= sizeof(footer);
assert(remaining > 10);
- char *buffer = (char *)g_malloc(remaining);
+ char *buffer = new char[remaining];
if (fread(buffer, 1, remaining, fp) != remaining) {
- g_free(buffer);
+ delete[] buffer;
return false;
}
@@ -98,7 +96,7 @@ ape_scan_internal(FILE *fp, ApeTagCallback callback)
remaining -= size;
}
- g_free(buffer);
+ delete[] buffer;
return true;
}