From 6e58a3c82137f47f41b82a8426a2d6e8be7c39bc Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Sun, 13 Dec 2009 00:15:41 -0800 Subject: [PATCH] Fix thinko in open_address if (!uri && uri[0] = '/') is obviously never going to be true ... Fix by just giving up in the !uri case. Strangely enough, I'm not hitting this in testing on the tablet -- perhaps gcc is optimizing out the test? --- dbus-server-bindings.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbus-server-bindings.c b/dbus-server-bindings.c index 3c7718e..b29b1ab 100644 --- a/dbus-server-bindings.c +++ b/dbus-server-bindings.c @@ -47,7 +47,11 @@ static void open_address(const char *uri) { char *new_uri; size_t new_uri_len; - if (!uri && uri[0] == '/') { + if (!uri) + /* Not much to do in this case ... */ + return; + + if (uri[0] == '/') { new_uri_len = strlen("file://") + strlen(uri) + 1; if (!(new_uri = calloc(new_uri_len, sizeof(char)))) exit(1); -- 1.7.9.5