netapp plugin: Don't access a struct after freeing it.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 30 Sep 2009 06:11:10 +0000 (08:11 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Wed, 30 Sep 2009 06:11:10 +0000 (08:11 +0200)
Thanks Sven :)

src/netapp.c

index 9bfaaa6..ab01b74 100644 (file)
@@ -384,11 +384,11 @@ static void free_host_config (host_config_t *hc) /* {{{ */
        free_cfg_volume_usage (hc->cfg_volume_usage);
        free_cfg_system (hc->cfg_system);
 
-       sfree (hc);
-
        if (hc->srv != NULL)
                na_server_close (hc->srv);
 
+       sfree (hc);
+
        free_host_config (next);
 } /* }}} void free_host_config */