Remove a few more leftover memory allocation checks

According to the glib memory allocation documentation, if any memory
allocation calls fail the application will be terminated so there is no
need to check if the call succeeded.
This commit is contained in:
Nikos Tsipinakis 2017-02-20 17:25:59 +02:00
parent 4df1a4b731
commit 92e83a939f
2 changed files with 0 additions and 4 deletions

View File

@ -49,7 +49,6 @@ section_t *new_section(char *name)
section_count++; section_count++;
sections = g_realloc(sections, sizeof(section_t) * section_count); sections = g_realloc(sections, sizeof(section_t) * section_count);
if(sections == NULL) die("Unable to allocate memory.\n", 1);
sections[section_count - 1].name = g_strdup(name); sections[section_count - 1].name = g_strdup(name);
sections[section_count - 1].entries = NULL; sections[section_count - 1].entries = NULL;
sections[section_count - 1].entry_count = 0; sections[section_count - 1].entry_count = 0;

View File

@ -1378,9 +1378,6 @@ void x_shortcut_init(keyboard_shortcut * ks)
char *str = g_strdup(ks->str); char *str = g_strdup(ks->str);
char *str_begin = str; char *str_begin = str;
if (str == NULL)
die("Unable to allocate memory", EXIT_FAILURE);
while (strchr(str, '+')) { while (strchr(str, '+')) {
char *mod = str; char *mod = str;
while (*str != '+') while (*str != '+')