Commit eac02a4a authored by Pawel Wodkowski's avatar Pawel Wodkowski Committed by Daniel Verkamp
Browse files

conf: don't strdup name if section already exist

parent c099f120
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -483,13 +483,15 @@ parse_line(struct spdk_conf *cp, char *lp)
		if (sp == NULL) {
		if (sp == NULL) {
			sp = allocate_cf_section();
			sp = allocate_cf_section();
			append_cf_section(cp, sp);
			append_cf_section(cp, sp);
		}

		cp->current_section = sp;
			sp->name = strdup(key);
			sp->name = strdup(key);
			if (sp->name == NULL) {
			if (sp->name == NULL) {
				SPDK_ERRLOG("cannot duplicate %s to sp->name\n", key);
				SPDK_ERRLOG("cannot duplicate %s to sp->name\n", key);
				return -1;
				return -1;
			}
			}
		}
		cp->current_section = sp;



		sp->num = num;
		sp->num = num;
	} else {
	} else {