Author: David Rheinsberg <david.rheinsberg@gmail.com>
Origin: backport, https://github.com/bus1/dbus-broker/commit/6d9b817b7c165be9addbc28b9e84d7ed1697d11a
Description: launch/service: fix release of argv array
 While service_free() correctly releases the strv in `argv`, the
 service_update() path does not. It frees `argv`, but not the individual
 entries. Fix this and properly release all entries.
--- a/src/launch/service.c
+++ b/src/launch/service.c
@@ -96,8 +96,12 @@
 }
 
 int service_update(Service *service, const char *path, const char *unit, size_t argc, char **argv, const char *user, uid_t uid) {
+        size_t i;
+
         service->path = c_free(service->path);
         service->unit = c_free(service->unit);
+        for (i = 0; i < service->argc; ++i)
+                free(service->argv[i]);
         service->argc = 0;
         service->argv = c_free(service->argv);
         service->user = c_free(service->user);
@@ -122,7 +126,7 @@
 
                 service->argc = argc;
 
-                for (size_t i = 0; i < argc; ++i) {
+                for (i = 0; i < argc; ++i) {
                         service->argv[i] = strdup(argv[i]);
                         if (!service->argv[i])
                                 return error_origin(-ENOMEM);
