diff options
Diffstat (limited to 'src/Common/Keyfiles.c')
-rw-r--r-- | src/Common/Keyfiles.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Common/Keyfiles.c b/src/Common/Keyfiles.c index c634efaf..366d65ee 100644 --- a/src/Common/Keyfiles.c +++ b/src/Common/Keyfiles.c @@ -128,9 +128,11 @@ void KeyFileCloneAll (KeyFile *firstKeyFile, KeyFile **outputKeyFile) {
KeyFile *cloneFirstKeyFile = KeyFileClone (firstKeyFile);
KeyFile *kf;
- KeyFileRemoveAll (outputKeyFile);
+ // free output only if different from input
+ if (*outputKeyFile != firstKeyFile)
+ KeyFileRemoveAll (outputKeyFile);
if (firstKeyFile)
{
kf = firstKeyFile->Next;
while (kf != NULL)
|