summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Majerech <majerech.o@gmail.com>2014-09-11 15:53:15 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-09-12 09:38:39 +0300
commit03db71caea98f8a2c5d302763289495ea2b30596 (patch)
tree813dcc7316eaa656b2737eaab62587390595307d
parent5e3b693a117e227e21df1826fcfe4baf2e01c08a (diff)
downloadweston-03db71caea98f8a2c5d302763289495ea2b30596.tar.gz
weston-03db71caea98f8a2c5d302763289495ea2b30596.tar.bz2
weston-03db71caea98f8a2c5d302763289495ea2b30596.zip
compositor: Don't free an uninitialised pointer.
When backend_init returns NULL, we goto out_signals, which wants to free(modules), but in this particular code path, modules hasn't been initialised leading to a "Double-free or corruption" error message. Initialising modules to NULL makes the free a no-op in this scenario. Signed-off-by: Ondřej Majerech <majerech.o@gmail.com> Reviewed-by: Ryo Munakata <ryomnktml@gmail.com>
-rw-r--r--src/compositor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compositor.c b/src/compositor.c
index b0bc86c9..a2197662 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -4335,7 +4335,8 @@ int main(int argc, char *argv[])
int i, fd;
char *backend = NULL;
char *shell = NULL;
- char *modules, *option_modules = NULL;
+ char *modules = NULL;
+ char *option_modules = NULL;
char *log = NULL;
char *server_socket = NULL, *end;
int32_t idle_time = 300;