X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=lib%2Fstrdup.c;h=3b776b1845868a1be04c71fc257bc1887edbb330;hb=867eb33477c07331e7b58302119308d02a02ee01;hp=a997b12f2c3b0ee03076343f9506ed861dd3967a;hpb=32de14ae0782822e9c54c3fbb28cdefc1f4de969;p=platform%2Fupstream%2Fcurl.git diff --git a/lib/strdup.c b/lib/strdup.c index a997b12..3b776b1 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -19,12 +19,12 @@ * KIND, either express or implied. * ***************************************************************************/ +/* + * This file is 'mem-include-scan' clean. See test 1132. + */ #include "curl_setup.h" -#include "strdup.h" -#include "curl_memory.h" -/* The last #include file should be: */ -#include "memdebug.h" +#include "strdup.h" #ifndef HAVE_STRDUP char *curlx_strdup(const char *str) @@ -50,24 +50,3 @@ char *curlx_strdup(const char *str) } #endif - -/*************************************************************************** - * - * Curl_memdup(source, length) - * - * Copies the 'source' data to a newly allocated buffer (that is - * returned). Copies 'length' bytes. - * - * Returns the new pointer or NULL on failure. - * - ***************************************************************************/ -char *Curl_memdup(const char *src, size_t length) -{ - char *buffer = malloc(length); - if(!buffer) - return NULL; /* fail */ - - memcpy(buffer, src, length); - - return buffer; -}