Re: [PATCH 4/4] tools: hv: Parse /etc/os-release

From: Alan Cox
Date: Wed Sep 05 2012 - 12:53:38 EST


> + if (!strcmp(buf, "NAME"))
> + os_name = strdup(value);
> + else if (!strcmp(buf, "VERSION_ID"))
> + os_major = strdup(value);

strdup can fail. The case where it leaks because NAME= occurs twice is
harmless enough but the strdup ought to be checked or add an x_strdup()
helper.

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/