don't check for NULL before XFREE
authorChristos Zoulas <christos@zoulas.com>
Thu, 6 Oct 2011 14:38:15 +0000 (10:38 -0400)
committerChristos Zoulas <christos@zoulas.com>
Thu, 6 Oct 2011 14:38:15 +0000 (10:38 -0400)
strdup -> xstrdup

amd/srvr_amfs_auto.c

index 250111f6d290aa737f3da1fb9ca003a2eba97440..93afe45a1ccbc8ddea79685bd46f40eee75ca711 100644 (file)
@@ -69,7 +69,7 @@ amfs_generic_find_srvr(mntfs *mf)
   if (!fs) {
     fs = ALLOC(struct fserver);
     fs->fs_refc = 0;
-    fs->fs_host = strdup("localhost");
+    fs->fs_host = xstrdup("localhost");
     fs->fs_ip = NULL;
     fs->fs_cid = 0;
     fs->fs_pinger = AM_PINGER;
@@ -135,8 +135,7 @@ timeout_srvr(voidp v)
     /*
      * Free the net address
      */
-    if (fs->fs_ip)
-      XFREE(fs->fs_ip);
+    XFREE(fs->fs_ip);
 
     /*
      * Free the host name.