diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-03-22 22:00:49 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-03-22 23:08:17 -0400 |
commit | 9e1fe7c3db6f335a9e1c2fac2fe2b7443076b29b (patch) | |
tree | 1769ed2a96a3383b77b5bf17c20f876f4267c0bd /src | |
parent | cb695f05c5bb7d188090b570c22a8231f8e02afe (diff) |
bus: don't free an unallocated var
Also remove unused variable.
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index 88f17a2600..0acc6b2d1e 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -972,11 +972,10 @@ static int message_make(sd_bus *bus, size_t size, sd_bus_message **m) { assert(bus->state == BUS_RUNNING || bus->state == BUS_HELLO); if (bus->rbuffer_size > size) { - b = memdup((const uint8_t*) bus->rbuffer + size, bus->rbuffer_size - size); - if (!b) { - free(t); + b = memdup((const uint8_t*) bus->rbuffer + size, + bus->rbuffer_size - size); + if (!b) return -ENOMEM; - } } r = bus_message_from_malloc(bus->rbuffer, size, @@ -1536,7 +1535,6 @@ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) { } static int process_timeout(sd_bus *bus) { - _cleanup_bus_message_unref_ sd_bus_message *reply = NULL; struct reply_callback *c; usec_t n; int r; |