From 657be653400bdb9fc8ab13037e51ecfbc1af9d40 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 6 Apr 2007 01:04:07 +0000 Subject: Misc fixes, plugged a memory leak in runscript.c and use va_copy to avoid nasty segfaults --- src/librc-daemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/librc-daemon.c') diff --git a/src/librc-daemon.c b/src/librc-daemon.c index 13362d8c..dcac300c 100644 --- a/src/librc-daemon.c +++ b/src/librc-daemon.c @@ -448,8 +448,9 @@ bool rc_service_started_daemon (const char *service, const char *exec, if (indx > 0) { - file = rc_xmalloc (sizeof (char *) * 10); - snprintf (file, sizeof (file), "%03d", indx); + int len = sizeof (char *) * 10; + file = rc_xmalloc (len); + snprintf (file, len, "%03d", indx); retval = _match_daemon (dirpath, file, mexec, NULL, NULL); free (file); } -- cgit v1.2.3