From 5403a48f6cb69bb88b684cbd206819f7d28c0b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Tue, 18 Sep 2007 19:34:43 +0000 Subject: [PATCH] fix memory access after freeing git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@2217 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- kit/dwt.c | 8 ++++---- winradio/g303.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/kit/dwt.c b/kit/dwt.c index fc885267a..77b422054 100644 --- a/kit/dwt.c +++ b/kit/dwt.c @@ -2,7 +2,7 @@ * Hamlib KIT backend - Digital World Traveller DRM receiver description * Copyright (c) 2005 by Stephane Fillod * - * $Id: dwt.c,v 1.2 2005-11-01 23:40:35 fillods Exp $ + * $Id: dwt.c,v 1.3 2007-09-18 19:34:43 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -322,13 +322,13 @@ int dwtdll_cleanup(RIG *rig) if (!rig) return -RIG_EINVAL; + /* Clean up the dll access */ + FreeLibrary(priv->dll); + if (rig->state.priv) free(rig->state.priv); rig->state.priv = NULL; - /* Clean up the dll access */ - FreeLibrary(priv->dll); - return RIG_OK; } diff --git a/winradio/g303.c b/winradio/g303.c index f59301476..d4ea23753 100644 --- a/winradio/g303.c +++ b/winradio/g303.c @@ -2,7 +2,7 @@ * Hamlib WiNRADiO backend - WR-G303 description * Copyright (c) 2001-2004 by Stephane Fillod * - * $Id: g303.c,v 1.4 2004-08-23 19:48:41 fillods Exp $ + * $Id: g303.c,v 1.5 2007-09-18 19:34:43 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -260,13 +260,13 @@ int g3_cleanup(RIG *rig) if (!rig) return -RIG_EINVAL; + /* Clean up the dll access */ + FreeLibrary(priv->dll); + if (rig->state.priv) free(rig->state.priv); rig->state.priv = NULL; - /* Clean up the dll access */ - FreeLibrary(priv->dll); - return RIG_OK; }