tag/ApeLoader: use new[]/delete[] instead of g_malloc()/g_free()
This commit is contained in:
parent
b978126bb0
commit
02fcf184b5
@ -22,8 +22,6 @@
|
|||||||
#include "system/ByteOrder.hxx"
|
#include "system/ByteOrder.hxx"
|
||||||
#include "fs/FileSystem.hxx"
|
#include "fs/FileSystem.hxx"
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -61,9 +59,9 @@ ape_scan_internal(FILE *fp, ApeTagCallback callback)
|
|||||||
remaining -= sizeof(footer);
|
remaining -= sizeof(footer);
|
||||||
assert(remaining > 10);
|
assert(remaining > 10);
|
||||||
|
|
||||||
char *buffer = (char *)g_malloc(remaining);
|
char *buffer = new char[remaining];
|
||||||
if (fread(buffer, 1, remaining, fp) != remaining) {
|
if (fread(buffer, 1, remaining, fp) != remaining) {
|
||||||
g_free(buffer);
|
delete[] buffer;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +96,7 @@ ape_scan_internal(FILE *fp, ApeTagCallback callback)
|
|||||||
remaining -= size;
|
remaining -= size;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(buffer);
|
delete[] buffer;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user