check NULL
This commit is contained in:
parent
760346ed08
commit
a0528c5585
1 changed files with 4 additions and 0 deletions
|
|
@ -125,6 +125,10 @@ struct udev_device *udev_device_get_parent(struct udev_device *udev_device)
|
|||
|
||||
path = strdup(udev_device_get_syspath(udev_device));
|
||||
|
||||
if (!path) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
do {
|
||||
if ((tmp = strrchr(path, '/'))) {
|
||||
*tmp = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue