summaryrefslogtreecommitdiff
path: root/shared/config-parser.c
diff options
context:
space:
mode:
authorMun Gwan-gyeong <elongbug@gmail.com>2013-05-28 00:20:04 +0900
committerKristian Høgsberg <krh@bitplanet.net>2013-05-28 15:30:27 -0400
commit7732540f71822044744404414f0e9aa578bf2c0f (patch)
treecb211e43a6f2d30ab13056af7326296ebaa1654b /shared/config-parser.c
parent151a52834e4a0d5adb5e9f783f175ee369273820 (diff)
config-parser: Avoid null dereference when exiting. (case: weston starts without config file.)
backtrace: (gdb) bt #0 0xb7704424 in __kernel_vsyscall () #1 0xb757ddde in raise (sig=5) at ../nptl/sysdeps/unix/sysv/linux/pt-raise.c:42 #2 <signal handler called> #3 weston_config_destroy (config=0x0) at config-parser.c:508 #4 0xb75cbc0e in x11_destroy (ec=0x93506b0) at compositor-x11.c:1473 #5 0x0804e0e9 in main (argc=1, argv=0xbffe5354) at compositor.c:3337
Diffstat (limited to 'shared/config-parser.c')
-rw-r--r--shared/config-parser.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/shared/config-parser.c b/shared/config-parser.c
index eec3e9e9..1d88eed0 100644
--- a/shared/config-parser.c
+++ b/shared/config-parser.c
@@ -505,6 +505,9 @@ weston_config_destroy(struct weston_config *config)
struct weston_config_section *s, *next_s;
struct weston_config_entry *e, *next_e;
+ if (config == NULL)
+ return;
+
wl_list_for_each_safe(s, next_s, &config->section_list, link) {
wl_list_for_each_safe(e, next_e, &s->entry_list, link) {
free(e->key);