]> git.sesse.net Git - ffmpeg/commitdiff
avformat/os_support: Use av_freep() to avoid leaving stale pointers in memory
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 22 Dec 2014 10:49:35 +0000 (11:49 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 22 Dec 2014 11:03:34 +0000 (12:03 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/os_support.c

index f9d6eeaf90b3c1470593fb2eab3078aec72513fc..7950e44889130f1498ce7bf0b74f28ed902ca562 100644 (file)
@@ -159,9 +159,9 @@ void ff_freeaddrinfo(struct addrinfo *res)
     }
 #endif /* HAVE_WINSOCK2_H */
 
-    av_free(res->ai_canonname);
-    av_free(res->ai_addr);
-    av_free(res);
+    av_freep(&res->ai_canonname);
+    av_freep(&res->ai_addr);
+    av_freep(&res);
 }
 
 int ff_getnameinfo(const struct sockaddr *sa, int salen,