-
Notifications
You must be signed in to change notification settings - Fork 254
lib/: sget*ent(): Simplify by calling strdup(3) #1146
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
Conversation
64c62b1 to
b3cf85c
Compare
07fbf22 to
a4efdf5
Compare
a4efdf5 to
0eff731
Compare
410ba3f to
d9c502a
Compare
d9c502a to
cb73a7f
Compare
0f8175e to
36c6929
Compare
36c6929 to
d2cd06c
Compare
d2cd06c to
b2ff9d1
Compare
58f0fdd to
0c63eda
Compare
While at it, rename the function parameter. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This makes these APIs more consistent with the ones for groups, which strdup(3) memory as necessary. It also makes the code simpler. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Call it 'dup', which reminds that it's a strdup(3)d string. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Just like the other sget*ent() functions do. Signed-off-by: Alejandro Colomar <alx@kernel.org>
0c63eda to
1c836ba
Compare
hallyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but is there any reason why you can't just drop the 'static' modifier and stop doing the first 'free'?
Thanks!
I remember having looked into it back then, but I don't remember my findings. :) I'd like to attempt that in a separate PR in the future. |
|
Ok, sounds good, thanks. |
While at it, rename the function parameter.
v1b
v1c
v1d
v1e
v1f
v1g
v1h
v1i
v1j
v1k
v1l
v1m