Initialize the rootfh handle when creating the nfs context or else
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 31 Jul 2011 00:59:46 +0000 (10:59 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 31 Jul 2011 00:59:46 +0000 (10:59 +1000)
we will try to free a wild pointer if the mount failed
and we proceed to call nfs_destroy_context();

lib/libnfs.c

index c3904bf8eed666dee1af3bc4ffd6a2c87ce3fc14..edaeca4df06fb3afdc6ecbc090494fe807663521 100644 (file)
@@ -147,6 +147,9 @@ struct nfs_context *nfs_init_context(void)
        nfs->server = NULL;
        nfs->export = NULL;
 
+       nfs->rootfh.data.data_len = 0;
+       nfs->rootfh.data.data_val = NULL;
+
        return nfs;
 }