[FFmpeg-cvslog] avstring-test: fix memory leaks

Mans Rullgard git at videolan.org
Sat Oct 13 16:44:27 CEST 2012


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Fri Oct 12 22:20:09 2012 +0100| [0daac647af00b7cf591d1360115a725e300ca3b2] | committer: Mans Rullgard

avstring-test: fix memory leaks

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0daac647af00b7cf591d1360115a725e300ca3b2
---

 libavutil/avstring.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/avstring.c b/libavutil/avstring.c
index 9b88c0b..6b3a65c 100644
--- a/libavutil/avstring.c
+++ b/libavutil/avstring.c
@@ -197,10 +197,12 @@ int main(void)
         };
 
         for (i=0; i < FF_ARRAY_ELEMS(strings); i++) {
-            const char *p= strings[i];
+            const char *p = strings[i], *q;
             printf("|%s|", p);
-            printf(" -> |%s|", av_get_token(&p, ":"));
+            q = av_get_token(&p, ":");
+            printf(" -> |%s|", q);
             printf(" + |%s|\n", p);
+            av_free(q);
         }
     }
 



More information about the ffmpeg-cvslog mailing list