aboutsummaryrefslogtreecommitdiff
path: root/src/librc-daemon.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-06 01:04:07 +0000
committerRoy Marples <roy@marples.name>2007-04-06 01:04:07 +0000
commit657be653400bdb9fc8ab13037e51ecfbc1af9d40 (patch)
tree8e876d2a345eb56dff9b7c732a082bc00720d020 /src/librc-daemon.c
parent308042c87bd920d787265f1854bf1695bdbab8e4 (diff)
Misc fixes, plugged a memory leak in runscript.c and use va_copy to avoid nasty segfaults
Diffstat (limited to 'src/librc-daemon.c')
-rw-r--r--src/librc-daemon.c5
1 files changed, 3 insertions, 2 deletions
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);
}