dispatcher: fix abort in case of an error (rh #1275813)
authorJiří Klimeš <jklimes@redhat.com>
Fri, 30 Oct 2015 12:44:15 +0000 (13:44 +0100)
committerJiří Klimeš <jklimes@redhat.com>
Fri, 30 Oct 2015 13:00:15 +0000 (14:00 +0100)
request_free() can be called on an error.

Oct 27 20:27:46 localhost.localdomain nm-dispatcher[2328]: #1 'pre-up': completed: invalid request: Missing or invalid required value path!
Oct 27 20:27:46 localhost.localdomain nm-dispatcher[2328]: **
Oct 27 20:27:46 localhost.localdomain nm-dispatcher[2328]: ERROR:nm-dispatcher.c:203:request_free: assertion failed (request->num_scripts_done == request->scripts->len): (0 == 1)

Fixes: 1999723241c49a7f2d5052d34299aad3d6e26e41

https://bugzilla.redhat.com/show_bug.cgi?id=1275813

callouts/nm-dispatcher.c

index 48399e6..ee972fa 100644 (file)
@@ -720,6 +720,7 @@ handle_action (NMDBusDispatcher *dbus_dispatcher,
 
                results = g_variant_new_array (G_VARIANT_TYPE ("(sus)"), NULL, 0);
                g_dbus_method_invocation_return_value (context, g_variant_new ("(@a(sus))", results));
+               request->num_scripts_done = request->scripts->len;
                request_free (request);
                return TRUE;
        }