mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 00:46:00 +01:00
fix 'path may be used unitialized'
This commit is contained in:
parent
de52bae4da
commit
2a35825247
1 changed files with 2 additions and 5 deletions
|
@ -17,12 +17,12 @@ zathura_database_t*
|
||||||
zathura_db_init(const char* dir)
|
zathura_db_init(const char* dir)
|
||||||
{
|
{
|
||||||
if (dir == NULL) {
|
if (dir == NULL) {
|
||||||
goto error_ret;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char* path = g_build_filename(dir, DATABASE, NULL);
|
char* path = g_build_filename(dir, DATABASE, NULL);
|
||||||
if (path == NULL) {
|
if (path == NULL) {
|
||||||
goto error_ret;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
zathura_database_t* db = g_malloc0(sizeof(zathura_database_t));
|
zathura_database_t* db = g_malloc0(sizeof(zathura_database_t));
|
||||||
|
@ -65,9 +65,6 @@ zathura_db_init(const char* dir)
|
||||||
error_free:
|
error_free:
|
||||||
|
|
||||||
zathura_db_free(db);
|
zathura_db_free(db);
|
||||||
|
|
||||||
error_ret:
|
|
||||||
|
|
||||||
g_free(path);
|
g_free(path);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue