From: Alan T. DeKok Date: Wed, 17 May 2017 15:41:57 +0000 (-0400) Subject: check for OOM. Found by PVS-Studio X-Git-Tag: release_3_0_14~24 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=freeradius.git;a=commitdiff_plain;h=17dfb31f3146e61b492fffddd1163a5996a6b950 check for OOM. Found by PVS-Studio --- diff --git a/src/main/modcall.c b/src/main/modcall.c index 594c2f7..c385db2 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -2095,7 +2095,12 @@ static modcallable *do_compile_modxlat(modcallable *parent, memcpy(csingle->actions, defaultactions[component][GROUPTYPE_SIMPLE], sizeof(csingle->actions)); - mx->xlat_name = strdup(fmt); + mx->xlat_name = talloc_strdup(mx, fmt); + if (!mx->xlat_name) { + talloc_free(mx); + return NULL; + } + if (fmt[0] != '%') { char *p; mx->exec = true;