]> granicus.if.org Git - curl/commitdiff
Don't strdup an empty string
authorDan Fandrich <dan@coneharvesters.com>
Thu, 27 Sep 2007 18:39:10 +0000 (18:39 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 27 Sep 2007 18:39:10 +0000 (18:39 +0000)
lib/getenv.c

index 475c3d3ca5897a82e296d109d3b918d5e0186f46..ca88234fa50758d1cd5e07ff8595ed89b2dcc0f1 100644 (file)
@@ -55,7 +55,7 @@ char *GetEnv(const char *variable)
   if (env && strcmp("HOME",variable) == 0)
     env = decc$translate_vms(env);
 #endif
-  return env?strdup(env):NULL;
+  return (env && env[0])?strdup(env):NULL;
 #endif
 #endif
 }