]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check for NULL, and free on error. CID #1503946
authorAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 23:45:50 +0000 (19:45 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 11 Apr 2022 23:46:27 +0000 (19:46 -0400)
src/modules/rlm_csv/rlm_csv.c

index 37453281eee6b4373856aa22c764736f066dfea3..3fb4ac47c12ceb5207d3875029a3b0cf15f2dc09 100644 (file)
@@ -230,9 +230,13 @@ static bool duplicate_entry(CONF_SECTION *conf, rlm_csv_t *inst, rlm_csv_entry_t
        talloc_set_type(e, rlm_csv_entry_t);
 
        e->key = fr_value_box_alloc_null(e);
+       if (!e->key) goto fail;
+
        if (fr_value_box_from_str(e->key, e->key, type, NULL, p, strlen(p), NULL, false) < 0) {
                cf_log_err(conf, "Failed parsing key field in file %s line %d - %s", inst->filename, lineno,
                           fr_strerror());
+       fail:
+               talloc_free(e);
                return false;
        }