Fix seg-fault in recent 'hammer cleanup' utility work.
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 8 Dec 2008 03:55:28 +0000 (19:55 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 8 Dec 2008 03:55:28 +0000 (19:55 -0800)
Reported-by: Rumko <rumcic@gmail.com>
sbin/hammer/cmd_cleanup.c

index 8366286..ef4e448 100644 (file)
@@ -511,7 +511,7 @@ cleanup_softlinks(const char *path __unused, const char *snapshots_path,
        char *fpath;
        int anylink = 0;
 
-       if (strstr(arg3, "any") != NULL)
+       if (arg3 != NULL && strstr(arg3, "any") != NULL)
                anylink = 1;
 
        if ((dir = opendir(snapshots_path)) != NULL) {