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

udev_list_entry_add: fix potential leak if strdup fails #41

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions udev_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ struct udev_list_entry *udev_list_entry_add(struct udev_list_entry *list_entry,
list_entry2->name = strdup(name);

if (!list_entry2->name) {
udev_list_entry_free(list_entry2);
return NULL;
}

if (value) {
list_entry2->value = strdup(value);

if (!list_entry2->value) {
udev_list_entry_free(list_entry2);
return NULL;
}
}
Expand Down