diff options
author | Roy Marples <roy@marples.name> | 2007-04-06 01:04:07 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-04-06 01:04:07 +0000 |
commit | 657be653400bdb9fc8ab13037e51ecfbc1af9d40 (patch) | |
tree | 8e876d2a345eb56dff9b7c732a082bc00720d020 /src/librc-daemon.c | |
parent | 308042c87bd920d787265f1854bf1695bdbab8e4 (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.c | 5 |
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); } |