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

lib/syslinux: Port to new code style #1154

Closed
wants to merge 2 commits into from

Conversation

cgwalters
Copy link
Member

There was only one tricky bit here around the ownership of the lines; I made use
of g_steal_pointer() to consistently track ownership, and converted to a for
loop while still preserving the loop logic around the last entry.

There was only one tricky bit here around the ownership of the lines; I made use
of `g_steal_pointer()` to consistently track ownership, and converted to a `for`
loop while still preserving the loop logic around the last entry.
{
char *line = *iter;
/* Take ownership of the string element */
g_autofree char *line = g_steal_pointer (iter);
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, there's a subtle issue here (which looks like it existed even before). g_strfreev stops at the first NULL it finds. If we break out of this loop earlier than expected, the remaining strings will never be freed, right? It seems like it's simpler to just g_strdup in that case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, you're right. Updated, also did some more re-indent while there ⬇️

@jlebon
Copy link
Member

jlebon commented Sep 8, 2017

@rh-atomic-bot r+ 4b2e738

@rh-atomic-bot
Copy link

⌛ Testing commit 4b2e738 with merge 067da21...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing 067da21 to master...

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.

3 participants