提交 9c8753fe 编写于 作者: M Michal Privoznik

virSecurityDeviceLabelDefNew: Avoid NULL dereference

While it is impossible for VIR_ALLOC() to return an error, we
should be consistent with the rest of the code and not continue
initializing the virSecurityDeviceLabelDef structure.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 ef4719ac
...@@ -77,7 +77,7 @@ virSecurityDeviceLabelDefNew(const char *model) ...@@ -77,7 +77,7 @@ virSecurityDeviceLabelDefNew(const char *model)
if (VIR_ALLOC(seclabel) < 0) { if (VIR_ALLOC(seclabel) < 0) {
virSecurityDeviceLabelDefFree(seclabel); virSecurityDeviceLabelDefFree(seclabel);
seclabel = NULL; return NULL;
} }
seclabel->model = g_strdup(model); seclabel->model = g_strdup(model);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册