Add random commentary to SOCKS code.
[u/mdw/putty] / misc.c
diff --git a/misc.c b/misc.c
index 3fea374..78d829a 100644 (file)
--- a/misc.c
+++ b/misc.c
 
 char *dupstr(const char *s)
 {
-    int len = strlen(s);
-    char *p = snewn(len + 1, char);
-    strcpy(p, s);
+    char *p = NULL;
+    if (s) {
+        int len = strlen(s);
+        p = snewn(len + 1, char);
+        strcpy(p, s);
+    }
     return p;
 }