decoder/sidplay: free songlength data blob in error handler

When parsing the songlength database fails, the code forgot to free
the memory allocated by the raw file data.
This commit is contained in:
Max Kellermann 2009-09-24 10:17:58 +02:00
parent 4729d10bb2
commit aec18c74ec
1 changed files with 4 additions and 3 deletions

View File

@ -61,8 +61,10 @@ sidplay_load_songlength_db(const char *path)
data[i] = '#';
GKeyFile *db = g_key_file_new();
if (!g_key_file_load_from_data(db, data, size,
G_KEY_FILE_NONE, &error)) {
bool success = g_key_file_load_from_data(db, data, size,
G_KEY_FILE_NONE, &error);
g_free(data);
if (!success) {
g_warning("unable to parse songlengths file %s: %s",
path, error->message);
g_error_free(error);
@ -71,7 +73,6 @@ sidplay_load_songlength_db(const char *path)
}
g_key_file_set_list_separator(db, ' ');
g_free(data);
return db;
}