Skip to content

Fix some memory leaks#944

Closed
m-blaha wants to merge 2 commits intodnf-4-masterfrom
mblaha/memory_leaks
Closed

Fix some memory leaks#944
m-blaha wants to merge 2 commits intodnf-4-masterfrom
mblaha/memory_leaks

Conversation

@m-blaha
Copy link
Copy Markdown
Member

@m-blaha m-blaha commented Apr 23, 2020

No description provided.

m-blaha added 2 commits April 23, 2020 15:27
When dnf_context_setup() is called twice, there is memory leak of
original content of native_arches.
Example where dnf_context_setup() is called twice from libdnf unit tests:

ctx = dnf_context_new();
ret = dnf_context_setup(ctx, NULL, &error);

and later on:

ret = dnf_context_clean_cache(ctx, flags, &error);

The dnf_context_clean_cache() function calls dnf_context_setup() and
triggers the memory leak.
@lukash
Copy link
Copy Markdown
Contributor

lukash commented Apr 23, 2020

@rh-atomic-bot r+

@rh-atomic-bot
Copy link
Copy Markdown

📌 Commit 3c631ea has been approved by lukash

@rh-atomic-bot
Copy link
Copy Markdown

⌛ Testing commit 3c631ea with merge 66880f9...

rh-atomic-bot pushed a commit that referenced this pull request Apr 23, 2020
Closes: #944
Approved by: lukash
rh-atomic-bot pushed a commit that referenced this pull request Apr 23, 2020
When dnf_context_setup() is called twice, there is memory leak of
original content of native_arches.
Example where dnf_context_setup() is called twice from libdnf unit tests:

ctx = dnf_context_new();
ret = dnf_context_setup(ctx, NULL, &error);

and later on:

ret = dnf_context_clean_cache(ctx, flags, &error);

The dnf_context_clean_cache() function calls dnf_context_setup() and
triggers the memory leak.

Closes: #944
Approved by: lukash
@rh-atomic-bot
Copy link
Copy Markdown

💔 Test failed - status-papr

@m-blaha
Copy link
Copy Markdown
Member Author

m-blaha commented Apr 24, 2020

@rh-atomic-bot retry

@rh-atomic-bot
Copy link
Copy Markdown

⌛ Testing commit 3c631ea with merge 67733d1...

rh-atomic-bot pushed a commit that referenced this pull request Apr 24, 2020
When dnf_context_setup() is called twice, there is memory leak of
original content of native_arches.
Example where dnf_context_setup() is called twice from libdnf unit tests:

ctx = dnf_context_new();
ret = dnf_context_setup(ctx, NULL, &error);

and later on:

ret = dnf_context_clean_cache(ctx, flags, &error);

The dnf_context_clean_cache() function calls dnf_context_setup() and
triggers the memory leak.

Closes: #944
Approved by: lukash
@rh-atomic-bot
Copy link
Copy Markdown

☀️ Test successful - status-papr
Approved by: lukash
Pushing 67733d1 to dnf-4-master...

jlebon added a commit to jlebon/libdnf that referenced this pull request Apr 24, 2020
We want to transfer ownership of the strings to the caller here, so we
shouldn't free the element here.

Regression from rpm-software-management#944.
jlebon added a commit to jlebon/libdnf that referenced this pull request Apr 24, 2020
We want to transfer ownership of the strings to the caller, so we
shouldn't free the element here.

Regression from rpm-software-management#944.
@jlebon
Copy link
Copy Markdown
Contributor

jlebon commented Apr 24, 2020

Follow up to this in #946.

rh-atomic-bot pushed a commit that referenced this pull request Apr 25, 2020
We want to transfer ownership of the strings to the caller, so we
shouldn't free the element here.

Regression from #944.

Closes: #946
Approved by: lukash
rh-atomic-bot pushed a commit that referenced this pull request Apr 27, 2020
We want to transfer ownership of the strings to the caller, so we
shouldn't free the element here.

Regression from #944.

Closes: #946
Approved by: lukash
rh-atomic-bot pushed a commit that referenced this pull request Apr 27, 2020
We want to transfer ownership of the strings to the caller, so we
shouldn't free the element here.

Regression from #944.

Closes: #946
Approved by: lukash
@m-blaha m-blaha deleted the mblaha/memory_leaks branch July 1, 2020 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants