]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check for OOM errors
authorAlan T. DeKok <aland@freeradius.org>
Wed, 6 Nov 2019 22:20:37 +0000 (17:20 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 6 Nov 2019 22:20:49 +0000 (17:20 -0500)
src/lib/util/dict_tokenize.c
src/lib/util/dict_util.c

index e226e67b687005de1cb9bc3c0e7b42edbf1ba14d..1ab3a186c2f52b494be89ad3371fbe611ea2b554 100644 (file)
@@ -1256,7 +1256,10 @@ static int dict_read_process_protocol(char **argv, int argc)
        /*
         *      Set the root attribute with the protocol name
         */
-       dict_root_set(dict, argv[0], value);
+       if (dict_root_set(dict, argv[0], value) < 0) {
+               talloc_free(dict);
+               return -1;
+       }
 
        if (dict_protocol_add(dict) < 0) return -1;
 
@@ -2257,7 +2260,7 @@ int fr_dict_internal_afrom_file(fr_dict_t **out, char const *dict_subdir)
        /*
         *      Set the root name of the dictionary
         */
-       dict_root_set(dict, "internal", 0);
+       if (dict_root_set(dict, "internal", 0) < 0) goto error;
 
        /*
         *      Add cast attributes.  We do it this way,
index 59b9b64f4c19e5b19ba969f4d1f0a7b8990960c6..4885910e33abc7624afa12e6c57cfec4611d5e55 100644 (file)
@@ -386,6 +386,8 @@ fr_dict_attr_t *dict_attr_alloc_name(TALLOC_CTX *ctx, char const *name)
        }
 
        da = talloc_zero(ctx, fr_dict_attr_t);
+       if (!da) return NULL;
+
        da->name = talloc_typed_strdup(da, name);
        if (!da->name) {
                talloc_free(da);