Skip to content

Commit

Permalink
Merge pull request #4926 from ElektraInitiative/memleak-4922
Browse files Browse the repository at this point in the history
lib: memory leak, fixes #4925
  • Loading branch information
atmaxinger committed May 15, 2023
2 parents d8a5905 + 63b3555 commit af273eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/news/_preparation_next_release.md
Expand Up @@ -230,7 +230,7 @@ The text below summarizes updates to the [C (and C++)-based libraries](https://w

- The `syslog` logging code now calls `openlog` before every `syslog` to avoid the use of a global variable. _(@kodebach)_
- <<TODO>>
- <<TODO>>
- Fix memleak in kdb.c, #4925 _(@hannes99)_
- <<TODO>>
- <<TODO>>
- <<TODO>>
Expand Down
4 changes: 4 additions & 0 deletions src/libs/elektra/kdb.c
Expand Up @@ -1934,14 +1934,18 @@ int kdbGet (KDB * handle, KeySet * ks, Key * parentKey)
ELEKTRA_SET_INTERNAL_ERROR (parentKey,
"Couldn't divide keys into mountpoints before poststorage. Please report this bug at "
"https://issues.libelektra.org.");
keyDel (defaultCutpoint);
ksDel (dataKs);
ksDel (defaults);
goto error;
}

// Step 16: run poststorage phase for non-spec:/
if (!runGetPhase (backends, parentKey, ELETKRA_KDB_GET_PHASE_POST_STORAGE_NONSPEC))
{
keyDel (defaultCutpoint);
ksDel (dataKs);
ksDel (defaults);
goto error;
}

Expand Down

0 comments on commit af273eb

Please sign in to comment.