From: Arran Cudbard-Bell Date: Fri, 2 Jan 2015 05:05:22 +0000 (-0500) Subject: Allow error to pass up from dict_unknown_from_substr X-Git-Tag: release_3_0_7~374 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69feb0315c5fca630038f843d3d8cb14a2b3e9e5;p=thirdparty%2Ffreeradius-server.git Allow error to pass up from dict_unknown_from_substr --- diff --git a/src/main/tmpl.c b/src/main/tmpl.c index 6a0c6f30093..2cd37003c07 100644 --- a/src/main/tmpl.c +++ b/src/main/tmpl.c @@ -831,6 +831,8 @@ ssize_t tmpl_from_attr_substr(value_pair_tmpl_t *vpt, char const *name, */ a = p; + fr_strerror(); /* Clear out any existing errors */ + /* * Attr-1.2.3.4 is OK. */ @@ -855,11 +857,11 @@ ssize_t tmpl_from_attr_substr(value_pair_tmpl_t *vpt, char const *name, /* * Can't parse it as an attribute, might be a literal string * let the caller decide. + * + * Don't alter the fr_strerror buffer, should contain the parse + * error from dict_unknown_from_substr. */ - if (!allow_undefined) { - fr_strerror_printf("Undefined attribute"); - return -(a - name); - } + if (!allow_undefined) return -(a - name); /* * Copy the name to a field for later resolution