Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler/ipp.c: Fix memory leaks found during #466 #469

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Sep 6, 2022

No description provided.

Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good - just remove the unnecessary "if (foo)" conditionals.

cups/ppd-cache.c Outdated
cupsFilePrintf(fp, "*cupsStringsURI %s: \"%s\"\n", keyword, ippGetString(attr, 0, NULL));
}

if (response)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to guard this - ippDelete ignores NULL pointers for you.

cups/ppd-cache.c Outdated
@@ -5006,6 +5010,9 @@ _ppdCreateFromIPP2(
unlink(buffer);
*buffer = '\0';

if (strings)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here - a NULL strings isn't a problem.

@zdohnal zdohnal force-pushed the create_local_leaks branch 4 times, most recently from 1cccad4 to 03eb67f Compare September 20, 2022 15:32
@zdohnal zdohnal merged commit 6fa35ac into OpenPrinting:master Sep 21, 2022
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.

2 participants