]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix minor leak in FileRotateByRenumber - Coverity scan
authorOliver Kurth <okurth@vmware.com>
Mon, 15 Apr 2019 18:33:00 +0000 (11:33 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 15 Apr 2019 18:33:00 +0000 (11:33 -0700)
open-vm-tools/lib/file/file.c

index 2d1154b38d844fa02bb48d38522658bb957b0520..7dae12c88673c8878c83005ad3d65212f771a905 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2019 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
@@ -2452,6 +2452,7 @@ FileRotateByRenumber(const char *filePath,       // IN: full path to file
    File_GetPathName(fullPathNoExt, &baseDir, &baseName);
 
    if ((baseDir == NULL) || (*baseDir == '\0')) {
+      free(baseDir);
       baseDir = Unicode_Duplicate(DIRSEPS);
    }