Commit aec18c74 authored by Max Kellermann's avatar Max Kellermann

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.
parent 4729d10b
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment