Commit d2a07069 authored by sunshihao520's avatar sunshihao520 Committed by Jim Harris
Browse files

lib/conf: check pointer return value when use calloc



add return value check when use calloc to create spdk_conf_section struct.

Signed-off-by: default avatarsunshihao <sunshihao@huawei.com>
Signed-off-by: default avatarlinfeilong <linfeilong@huawei.com>
Signed-off-by: default avatarliuzhqiang <liuzhiqiang26@huawei.com>
Signed-off-by: default avatarsuweifeng <suweifeng1@huawei.com>
Change-Id: Iab89491b7c6942337fa7b1ab765e7bb509c1e92b
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5051


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent be979ad1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -495,6 +495,10 @@ parse_line(struct spdk_conf *cp, char *lp)

		if (sp == NULL) {
			sp = allocate_cf_section();
			if (sp == NULL) {
				SPDK_ERRLOG("cannot allocate cf section\n");
				return -1;
			}
			append_cf_section(cp, sp);

			sp->name = strdup(key);