From: Paul Wolneykien Date: Tue, 2 Aug 2011 15:44:00 +0000 (+0400) Subject: Don't try to close a file that is not open X-Git-Url: http://git.altlinux.org/people/manowar/packages/xorg-drv-wacom.git?p=xorg-drv-wacom.git;a=commitdiff_plain;h=15d613a7cfe09529330596f8bc1d5a9def4a9df3 Don't try to close a file that is not open Don't try to close a file that is not open to avoid a segmentation fault. --- diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c index db0d83e..46f32a3 100644 --- a/src/wcmISDV4.c +++ b/src/wcmISDV4.c @@ -947,7 +947,8 @@ model_from_sysfs(const InputInfoPtr pInfo, int fd, int *id) out: udev_device_unref(device); udev_unref(udev); - fclose(file); + if (file) + fclose(file); free(sysfs_path); return model; }