open-vm-tools/SOURCES/ovt-Fix-minor-leak-in-FileR...

48 lines
1.7 KiB
Diff

From f9dcf9c252d3d1cb76aebd838300bdf3e973e77b Mon Sep 17 00:00:00 2001
From: Cathy Avery <cavery@redhat.com>
Date: Thu, 25 Jul 2019 12:32:27 +0200
Subject: [PATCH 04/16] Fix minor leak in FileRotateByRenumber - Coverity scan
RH-Author: Cathy Avery <cavery@redhat.com>
Message-id: <20190725123239.18274-5-cavery@redhat.com>
Patchwork-id: 89720
O-Subject: [RHEL8.1 open-vm-tools PATCH 04/16] Fix minor leak in FileRotateByRenumber - Coverity scan
Bugzilla: 1602648
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
commit 85bc2e71dd7a855d3c533965859c1756deecc314
Author: Oliver Kurth <okurth@vmware.com>
Date: Mon Apr 15 11:33:00 2019 -0700
Fix minor leak in FileRotateByRenumber - Coverity scan
Signed-off-by: Cathy Avery <cavery@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
open-vm-tools/lib/file/file.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/file/file.c b/lib/file/file.c
index 2d1154b..7dae12c 100644
--- a/lib/file/file.c
+++ b/lib/file/file.c
@@ -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);
}
--
1.8.3.1