From: Jon Trulson Date: Wed, 11 Apr 2018 22:04:16 +0000 (-0600) Subject: dtfile/dtcopy/dosync: CID 89374 X-Git-Tag: 2.2.4a~94 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c73ad48482b252e05b7bd1c3258c95bdb30833ac;p=oweals%2Fcde.git dtfile/dtcopy/dosync: CID 89374 --- diff --git a/cde/programs/dtfile/dtcopy/dosync.c b/cde/programs/dtfile/dtcopy/dosync.c index bc3dd8bb..a66404d1 100644 --- a/cde/programs/dtfile/dtcopy/dosync.c +++ b/cde/programs/dtfile/dtcopy/dosync.c @@ -299,7 +299,7 @@ GetDirEntry(char *fname, FileOp *op, int *rc) static int GetDir(char *dirname, PatternList *xl, PatternList *sl, DirEntry **listPP) { - DIR *dirP; /* open directory */ + DIR *dirP = NULL; /* open directory */ struct dirent *entryP; /* directory entry */ DirEntry *deP, *firstP, **linkPP; char fname[1024], *fnP; @@ -345,6 +345,7 @@ GetDir(char *dirname, PatternList *xl, PatternList *sl, DirEntry **listPP) /* if error occurred, call error callback function */ if (rc != 0 && syncErrorCallback && syncErrorCallback(op, fname, rc) < 0) { + closedir(dirP); FreeDir(firstP); return -1; }