diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/smbd/pidfile.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/smbd/pidfile.c b/source4/smbd/pidfile.c index da3f363ff9..de93a0390c 100644 --- a/source4/smbd/pidfile.c +++ b/source4/smbd/pidfile.c @@ -38,7 +38,9 @@ pid_t pidfile_pid(const char *piddir, const char *name) pid_t ret; char *pidFile; - asprintf(&pidFile, "%s/%s.pid", piddir, name); + if (asprintf(&pidFile, "%s/%s.pid", piddir, name) < 0) { + return 0; + } fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644); @@ -85,7 +87,10 @@ void pidfile_create(const char *piddir, const char *name) char *pidFile; pid_t pid; - asprintf(&pidFile, "%s/%s.pid", piddir, name); + if (asprintf(&pidFile, "%s/%s.pid", piddir, name) < 0) { + DEBUG(0,("ERROR: Out of memory\n")); + exit(1); + } pid = pidfile_pid(piddir, name); if (pid != 0) { |