diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-11-01 21:49:59 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-11-01 21:49:59 +0000 |
commit | 7f62028d668eaddd1aeaed42c8a0e3ce4947b51f (patch) | |
tree | 6b3ffb5f3d4b2e24d7ad18fcf39b440baa56f37c /src | |
parent | d34fe06fb0154d8005f54ab1d164acd6595a2f00 (diff) |
Toby Peterson patched a memory problem in the command line tool that
happened when a user had a home dir as an empty string. curl would then do
free() on a wrong area.
Diffstat (limited to 'src')
-rw-r--r-- | src/homedir.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/homedir.c b/src/homedir.c index f27aa6924..d9bc39fe5 100644 --- a/src/homedir.c +++ b/src/homedir.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -106,6 +106,8 @@ char *homedir(void) #endif if (home && home[0]) home = strdup(home); + else + home = NULL; } } #endif /* PWD-stuff */ |