diff options
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 639b9a6214..a1e6c9f973 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -609,6 +609,8 @@ _public_ int sd_bus_message_new_method_error( goto fail; } + t->error._need_free = -1; + *m = t; return 0; @@ -709,6 +711,8 @@ int bus_message_new_synthetic_error( goto fail; } + t->error._need_free = -1; + *m = t; return 0; @@ -3804,6 +3808,9 @@ int bus_message_parse_fields(sd_bus_message *m) { return -EBADMSG; r = message_peek_field_string(m, error_name_is_valid, &ri, &m->error.name); + if (r >= 0) + m->error._need_free = -1; + break; case SD_BUS_MESSAGE_HEADER_DESTINATION: |