diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2006-12-12 16:43:03 +0000 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2006-12-12 16:43:03 +0000 |
commit | 6419d6f7beb6af32facab158fcfb4f2dc973ccf0 (patch) | |
tree | 8129dac85b3fd1b92fb850428343bfbe116202f4 /xmalloc.c | |
parent | de26c86dffa492ba2ffdff021e88d9891f8be9f3 (diff) | |
download | fetchmail-6419d6f7beb6af32facab158fcfb4f2dc973ccf0.tar.gz fetchmail-6419d6f7beb6af32facab158fcfb4f2dc973ccf0.tar.bz2 fetchmail-6419d6f7beb6af32facab158fcfb4f2dc973ccf0.zip |
Fix crash on systems that do not provide strdup() in out-of-memory conditions.
Patch by Andreas Krennmair.
svn path=/branches/BRANCH_6-3/; revision=4988
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -63,7 +63,8 @@ char *strdup(const char *s) { char *p; p = (char *) malloc(strlen(s)+1); - strcpy(p,s); + if (p) + strcpy(p,s); return p; } #endif /* !HAVE_STRDUP */ |