]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix use after free. Bug found by Coverity
authorAlan T. DeKok <aland@freeradius.org>
Thu, 6 Sep 2012 08:57:53 +0000 (10:57 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 6 Sep 2012 09:33:24 +0000 (11:33 +0200)
src/lib/valuepair.c

index 965d107e599d0beebb1f4cdf27e00d42ef2e2d60..e5f2d9d3ad1781049122409146a0250f0b17d633 100644 (file)
@@ -958,8 +958,8 @@ VALUE_PAIR *pairparsevalue(VALUE_PAIR *vp, const char *value)
                                fr_ipaddr_t ipaddr;
 
                                if (ip_hton(cs, AF_INET, &ipaddr) < 0) {
-                                       free(s);
                                        fr_strerror_printf("Failed to find IP address for %s", cs);
+                                       free(s);
                                        return NULL;
                                }