The functions have to check for NULL pointer.

Signed-off-by: Karel Zak <[EMAIL PROTECTED]>
---
 mount/fstab.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/mount/fstab.c b/mount/fstab.c
index c47f20d..eee126e 100644
--- a/mount/fstab.c
+++ b/mount/fstab.c
@@ -293,8 +293,11 @@ has_label(const char *device, const char *label) {
        int ret;
 
        devlabel = fsprobe_get_label_by_devname(device);
+       if (!devlabel)
+               return 0;
+
        ret = !strcmp(label, devlabel);
-       /* free(devlabel); */
+       my_free(devlabel);
        return ret;
 }
 
@@ -304,8 +307,11 @@ has_uuid(const char *device, const char *uuid){
        int ret;
 
        devuuid = fsprobe_get_uuid_by_devname(device);
+       if (!devuuid)
+               return 0;
+
        ret = !strcmp(uuid, devuuid);
-       /* free(devuuid); */
+       my_free(devuuid);
        return ret;
 }
 
-- 
1.5.0.6

-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to