diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-11-07 10:55:25 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-11-11 10:03:48 +0100 |
commit | 0649433da53c7165f839e24e889e131e2894dd32 (patch) | |
tree | 7e516c1702fe87c09f190e5dc47ecd3a9bede1b8 /lib/rtsp.c | |
parent | cdfda3ee827da069f1871722278fd82e7cbb4194 (diff) | |
download | curl-0649433da53c7165f839e24e889e131e2894dd32.tar.gz |
realloc: use Curl_saferealloc to avoid common mistakes
Discussed: https://curl.haxx.se/mail/lib-2016-11/0087.html
Diffstat (limited to 'lib/rtsp.c')
-rw-r--r-- | lib/rtsp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rtsp.c b/lib/rtsp.c index d1bad19da..5da33d42c 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -36,6 +36,7 @@ #include "strcase.h" #include "select.h" #include "connect.h" +#include "strdup.h" /* The last 3 #include files should be in this order */ #include "curl_printf.h" #include "curl_memory.h" @@ -614,9 +615,9 @@ static CURLcode rtsp_rtp_readwrite(struct Curl_easy *data, if(rtspc->rtp_buf) { /* There was some leftover data the last time. Merge buffers */ - char *newptr = realloc(rtspc->rtp_buf, rtspc->rtp_bufsize + *nread); + char *newptr = Curl_saferealloc(rtspc->rtp_buf, + rtspc->rtp_bufsize + *nread); if(!newptr) { - Curl_safefree(rtspc->rtp_buf); rtspc->rtp_buf = NULL; rtspc->rtp_bufsize = 0; return CURLE_OUT_OF_MEMORY; |