mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 08:15:02 -05:00
[db] Fix memleak from unexpected return value, closes issue #909
On success the function was returning SQLITE_OK = 100, not 0, which made json_reply_library think that the operation failed. Credit @whatdoineed2do
This commit is contained in:
parent
248f82f3c8
commit
64c6007aad
6
src/db.c
6
src/db.c
@ -4415,7 +4415,9 @@ admin_get(void *value, const char *key, short type)
|
|||||||
default:
|
default:
|
||||||
DPRINTF(E_LOG, L_DB, "BUG: Unknown type %d in admin_set\n", type);
|
DPRINTF(E_LOG, L_DB, "BUG: Unknown type %d in admin_set\n", type);
|
||||||
|
|
||||||
ret = -2;
|
sqlite3_finalize(stmt);
|
||||||
|
sqlite3_free(query);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DB_PROFILE
|
#ifdef DB_PROFILE
|
||||||
@ -4426,7 +4428,7 @@ admin_get(void *value, const char *key, short type)
|
|||||||
sqlite3_finalize(stmt);
|
sqlite3_finalize(stmt);
|
||||||
sqlite3_free(query);
|
sqlite3_free(query);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
|
|
||||||
#undef Q_TMPL
|
#undef Q_TMPL
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user