On Tue, Feb 07, 2012 at 03:25:32PM +0100, Lennart Poettering wrote: > On Fri, 03.02.12 21:14, Michael Olbrich ([email protected]) wrote: > > > --- > > src/service.c | 6 ++++++ > > 1 files changed, 6 insertions(+), 0 deletions(-) > > > > diff --git a/src/service.c b/src/service.c > > index f030ccf..9bd3332 100644 > > --- a/src/service.c > > +++ b/src/service.c > > @@ -1726,6 +1726,12 @@ static int service_spawn( > > goto fail; > > } > > > > + if (s->watchdog_usec > 0) > > + if (asprintf(our_env + n_env++, "WATCHDOG_USEC=%llu", > > (unsigned long long) s->watchdog_usec) < 0) { > > + r = -ENOMEM; > > + goto fail; > > + } > > + > > our_env needs to be allocated larger for this. You need to increase the > new0() line to 5 instead of the current 4 char* objects.
Not in this case I think. An earlier commit removed on env variable without decreasing the new0() line. with this patch we have 3 possible env variables here: NOTIFY_SOCKET, MAINPID and WATCHDOG_USEC, so we need 4 char* objects, right? Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
