[vlc-devel] commit: Simplify free ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Aug 13 18:23:02 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Aug 13 19:25:48 2008 +0300| [975c118aebbc404462593b74898a50347a4f1883] | committer: Rémi Denis-Courmont 

Simplify free

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=975c118aebbc404462593b74898a50347a4f1883
---

 src/network/getaddrinfo.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c
index 49e7025..d8c44d7 100644
--- a/src/network/getaddrinfo.c
+++ b/src/network/getaddrinfo.c
@@ -206,16 +206,12 @@ static void WSAAPI freeaddrinfo (struct addrinfo *res)
 static void freeaddrinfo (struct addrinfo *res)
 #endif
 {
-    if (res != NULL)
-    {
-        if (res->ai_canonname != NULL)
-            free (res->ai_canonname);
-        if (res->ai_addr != NULL)
-            free (res->ai_addr);
-        if (res->ai_next != NULL)
-            free (res->ai_next);
-        free (res);
-    }
+    if (res == NULL)
+        return;
+    free (res->ai_canonname);
+    free (res->ai_addr);
+    free (res->ai_next);
+    free (res);
 }
 
 




More information about the vlc-devel mailing list