From: Matthew Dillon Date: Thu, 22 Aug 2019 15:35:32 +0000 (-0700) Subject: dphase - Stabilization X-Git-Tag: v5.8.0rc1~1104 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/6a3a20b1def3e172decabeec692f7c2ece85349e dphase - Stabilization * Fix a memory leak in scanit() * When fork()/forkpty() fails, provide a reason in log 00. --- diff --git a/usr.bin/dsynth/build.c b/usr.bin/dsynth/build.c index 12ce3208d4..dfa57df2c5 100644 --- a/usr.bin/dsynth/build.c +++ b/usr.bin/dsynth/build.c @@ -1762,8 +1762,8 @@ dophase(worker_t *work, wmsg_t *wmsg, int wdog, int phaseid, const char *phase) fcntl(MasterPtyFd, F_SETFL, O_NONBLOCK); if (pid < 0) { - dlog(DLOG_ALL, "[%03d] %s Fork Failed\n", - work->index, pkg->logfile); + dlog(DLOG_ALL, "[%03d] %s Fork Failed: %s\n", + work->index, pkg->logfile, strerror(errno)); ++work->accum_error; return; } diff --git a/usr.bin/dsynth/repo.c b/usr.bin/dsynth/repo.c index 0f28f8a1db..5baf6d049f 100644 --- a/usr.bin/dsynth/repo.c +++ b/usr.bin/dsynth/repo.c @@ -242,7 +242,6 @@ scanit(const char *path, const char *subpath, scanit(npath, den->d_name, countp, list_tailp); } - free(npath); } else if (S_ISREG(st.st_mode)) { item = calloc(1, sizeof(*item)); if (subpath) { @@ -255,9 +254,8 @@ scanit(const char *path, const char *subpath, *list_tailp = &item->next; ++*countp; ddprintf(0, "scan %s\n", item->spath); - } else { - free(npath); } + free(npath); } closedir(dir); }