diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-05-23 12:37:32 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-05-23 12:37:32 +0000 |
commit | fdf35f265ac239d8a28d1be58d96a82b219c88b7 (patch) | |
tree | c786d84a90a0fb0b1739b0254361aa3054d55ab9 /libavutil/mem.c | |
parent | 30897e764a63c993bc3d9a24521a71b00e3e7940 (diff) | |
download | ffmpeg-fdf35f265ac239d8a28d1be58d96a82b219c88b7.tar.gz |
make av_strdup(NULL) return NULL
Originally committed as revision 13250 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/mem.c')
-rw-r--r-- | libavutil/mem.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c index 8062ae81cb..3eaa366d53 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -139,11 +139,13 @@ void *av_mallocz(unsigned int size) char *av_strdup(const char *s) { - char *ptr; + char *ptr= NULL; + if(s){ int len = strlen(s) + 1; ptr = av_malloc(len); if (ptr) memcpy(ptr, s, len); + } return ptr; } |