Use g_try_malloc() instead of g_malloc()
Bug #503086 reported by
Aleksander Morgado
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
El Jardin |
Fix Released
|
Medium
|
Aleksander Morgado |
Bug Description
g_malloc() and g_malloc0() are used everywhere, and in the code, return value of the functions is always checked against NULL. The problem is that those functions will never return NULL: if no memory is available for allocation, they call g_error() internally and thus, SIGABRT.
Use g_try_malloc() and g_try_malloc0() instead, which will return NULL if memory allocation fails, and will not abort the execution of the program.
Changed in eljardin: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in eljardin: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Fixed in trunk.