From: Bert Vermeulen Date: Sun, 29 Jul 2012 00:15:34 +0000 (+0200) Subject: sr: extra checks for properly handling driverless devices X-Git-Tag: dsupstream~858 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=b04781bb2ba910d17b0bc11b499b1be352faa9cc;p=libsigrok.git sr: extra checks for properly handling driverless devices --- diff --git a/session.c b/session.c index 51dce2e4..92ee648a 100644 --- a/session.c +++ b/session.c @@ -88,7 +88,7 @@ SR_API int sr_session_destroy(void) static void sr_dev_close(struct sr_dev *dev) { - if (dev->driver->dev_close) + if (dev && dev->driver && dev->driver->dev_close) dev->driver->dev_close(dev->driver_index); }