diff --git a/lib/prefix.c b/lib/prefix.c index bc6afcf9f8..84a04c5300 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -665,7 +665,7 @@ str2prefix_ipv6 (const char *str, struct prefix_ipv6 *p) strncpy (cp, str, pnt - str); *(cp + (pnt - str)) = '\0'; ret = inet_pton (AF_INET6, cp, &p->prefix); - free (cp); + XFREE (MTYPE_TMP, cp); if (ret == 0) return 0; plen = (u_char) atoi (++pnt);