/*********************************************************
- * Copyright (C) 2006-2019 VMware, Inc. All rights reserved.
+ * Copyright (C) 2006-2020 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
/*
*-----------------------------------------------------------------------------
*
- * File_WalkDirectoryNextEntry --
+ * File_WalkDirectoryNext --
*
* Get the next file name during a directory traversal started with
* File_WalkDirectoryStart.
UNICODE_SUBSTITUTION_CHAR);
}
- if (HashTable_Insert(context->hash, allocName, NULL)) {
+ if (HashTable_Insert(context->hash, allocName, NULL)) { // Unique - good
if (fileName != NULL) {
*fileName = Util_SafeStrdup(allocName);
}
callAgain = TRUE;
break;
- } else {
- /* Ignore duplicates */
+ } else { // Duplicate - ignore
+ free(allocName);
continue;
}
}