From 96d96766fbfa157fddecb0498773867da9990507 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 14 Mar 2008 18:51:00 +0000 Subject: [PATCH] Don't try to unref a NULL GIOChannel git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3456 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- src/nm-serial-device.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nm-serial-device.c b/src/nm-serial-device.c index 7494d6ea5f..14a2e6dcd3 100644 --- a/src/nm-serial-device.c +++ b/src/nm-serial-device.c @@ -304,10 +304,13 @@ nm_serial_device_close (NMSerialDevice *device) if (priv->fd) { nm_debug ("Closing device '%s'", nm_device_get_iface (NM_DEVICE (device))); - g_io_channel_unref (priv->channel); + if (priv->channel) { + g_io_channel_unref (priv->channel); + priv->channel = NULL; + } + ioctl (priv->fd, TCSETA, &priv->old_t); close (priv->fd); - priv->fd = 0; } }