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:17 +0000 (11:33 +0200)
src/lib/valuepair.c

index 82cead0..d854918 100644 (file)
@@ -978,8 +978,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;
                                }