From c73ad48482b252e05b7bd1c3258c95bdb30833ac Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 11 Apr 2018 16:04:16 -0600 Subject: [PATCH] dtfile/dtcopy/dosync: CID 89374 --- cde/programs/dtfile/dtcopy/dosync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.25.1