lkml.org 
[lkml]   [2012]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] tools: hv: Parse /etc/os-release
> +			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


\
 
 \ /
  Last update: 2012-09-05 19:42    [W:0.066 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site