check for OOM. Found by PVS-Studio
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 May 2017 15:41:57 +0000 (11:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 19 May 2017 18:06:53 +0000 (14:06 -0400)
src/main/modcall.c

index 594c2f7..c385db2 100644 (file)
@@ -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;