Commit 88be0727 authored by Pavel Borzenkov's avatar Pavel Borzenkov Committed by Sebastian Ramacher

There is no need to check return value of g_malloc()

It never returns NULL. If this function fails, the application is
terminated.
Signed-off-by: default avatarPavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: default avatarSebastian Ramacher <s.ramacher@gmx.at>
parent 843a0513
......@@ -211,9 +211,6 @@ zathura_db_load_bookmarks(zathura_database_t* db, const char* file)
for (gsize i = 0; i < length; i++) {
zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t));
if (bookmark == NULL) {
continue;
}
bookmark->id = g_strdup(keys[i]);
bookmark->page = g_key_file_get_integer(db->bookmarks, file, keys[i], NULL);
......
......@@ -26,9 +26,6 @@ zathura_db_init(const char* dir)
}
zathura_database_t* db = g_malloc0(sizeof(zathura_database_t));
if (db == NULL) {
goto error_free;
}
/* create bookmarks database */
static const char SQL_BOOKMARK_INIT[] =
......@@ -188,9 +185,6 @@ zathura_db_load_bookmarks(zathura_database_t* db, const char* file)
while (sqlite3_step(stmt) == SQLITE_ROW) {
zathura_bookmark_t* bookmark = g_malloc0(sizeof(zathura_bookmark_t));
if (bookmark == NULL) {
continue;
}
bookmark->id = g_strdup((const char*) sqlite3_column_text(stmt, 0));
bookmark->page = sqlite3_column_int(stmt, 1);
......
......@@ -212,9 +212,6 @@ zathura_document_open(zathura_t* zathura, const char* path, const char* password
}
document = g_malloc0(sizeof(zathura_document_t));
if (document == NULL) {
goto error_free;
}
document->file_path = real_path;
document->password = password;
......@@ -497,10 +494,6 @@ zathura_index_element_new(const char* title)
zathura_index_element_t* res = g_malloc0(sizeof(zathura_index_element_t));
if (res == NULL) {
return NULL;
}
res->title = g_strdup(title);
return res;
......
......@@ -54,10 +54,6 @@ zathura_init(int argc, char* argv[])
zathura_t* zathura = g_malloc0(sizeof(zathura_t));
if (zathura == NULL) {
return NULL;
}
/* general */
zathura->document = NULL;
......
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