From: Arran Cudbard-Bell Date: Fri, 29 May 2015 15:24:00 +0000 (-0400) Subject: Parent may be NULL X-Git-Tag: release_3_0_9~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b443d3ed112da68caecd03be20bc7d9472209dec;p=thirdparty%2Ffreeradius-server.git Parent may be NULL --- diff --git a/src/main/conffile.c b/src/main/conffile.c index 0f18c033624..e70c4bf9814 100644 --- a/src/main/conffile.c +++ b/src/main/conffile.c @@ -450,7 +450,7 @@ CONF_SECTION *cf_section_alloc(CONF_SECTION *parent, char const *name1, char con * @note recursively duplicates any child sections. * @note does not duplicate any data associated with a section, or its child sections. * - * @param parent section. + * @param parent section (may be NULL). * @param cs to duplicate. * @param name1 of new section. * @param name2 of new section. @@ -475,7 +475,7 @@ CONF_SECTION *cf_section_dup(CONF_SECTION *parent, CONF_SECTION const *cs, new->item.lineno = cs->item.lineno; - if (!cs->item.filename || (strcmp(parent->item.filename, cs->item.filename) == 0)) { + if (!cs->item.filename || (parent && (strcmp(parent->item.filename, cs->item.filename) == 0))) { new->item.filename = parent->item.filename; } else { new->item.filename = talloc_strdup(new, cs->item.filename);