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:
		
							parent
							
								
									4df1a4b731
								
							
						
					
					
						commit
						92e83a939f
					
				| @ -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; | ||||||
|  | |||||||
							
								
								
									
										3
									
								
								src/x.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								src/x.c
									
									
									
									
									
								
							| @ -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 != '+') | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Nikos Tsipinakis
						Nikos Tsipinakis