Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix a crash when connection to dbus fails
[src/app-framework-main.git]
/
src
/
utils-jbus.c
diff --git
a/src/utils-jbus.c
b/src/utils-jbus.c
index
d58def9
..
201b0a6
100644
(file)
--- a/
src/utils-jbus.c
+++ b/
src/utils-jbus.c
@@
-391,7
+391,6
@@
struct jbus *create_jbus(int session, const char *path)
}
jbus->refcount = 1;
jbus->path = strdup(path);
}
jbus->refcount = 1;
jbus->path = strdup(path);
- jbus->name = NULL;
if (jbus->path == NULL) {
errno = ENOMEM;
goto error2;
if (jbus->path == NULL) {
errno = ENOMEM;
goto error2;
@@
-441,7
+440,8
@@
void jbus_unref(struct jbus *jbus)
{
struct jservice *srv;
if (!--jbus->refcount) {
{
struct jservice *srv;
if (!--jbus->refcount) {
- dbus_connection_unref(jbus->connection);
+ if (jbus->connection != NULL)
+ dbus_connection_unref(jbus->connection);
while((srv = jbus->services) != NULL) {
jbus->services = srv->next;
free(srv->method);
while((srv = jbus->services) != NULL) {
jbus->services = srv->next;
free(srv->method);