[libvirt] [PATCH 0/2] Two additional build fixes

Both pushed as trivial and build-breakers. Jiri Denemark (2): apparmor: Avoid freeing uninitialized pointer selinux: Properly indent preprocessor directives src/security/security_apparmor.c | 2 +- src/security/security_selinux.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) -- 1.8.1.1

--- src/security/security_apparmor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index 2b9c337..c23ba87 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -150,61 +150,61 @@ profile_status_file(const char *str) virReportOOMError(); goto failed; } if (strstr(content, tmp) != NULL) rc = 0; else rc = 1; failed: VIR_FREE(tmp); VIR_FREE(profile); VIR_FREE(content); return rc; } /* * load (add) a profile. Will create one if necessary */ static int load_profile(virSecurityManagerPtr mgr, const char *profile, virDomainDefPtr def, const char *fn, bool append) { int rc = -1; bool create = true; char *xml = NULL; - virCommandPtr cmd; + virCommandPtr cmd = NULL; const char *probe = virSecurityManagerGetAllowDiskFormatProbing(mgr) ? "1" : "0"; xml = virDomainDefFormat(def, VIR_DOMAIN_XML_SECURE); if (!xml) goto cleanup; if (profile_status_file(profile) >= 0) create = false; cmd = virCommandNewArgList(VIRT_AA_HELPER, "-p", probe, create ? "-c" : "-r", "-u", profile, NULL); if (!create && fn) { if (append) { virCommandAddArgList(cmd, "-F", fn, NULL); } else { virCommandAddArgList(cmd, "-f", fn, NULL); } } virCommandSetInputBuffer(cmd, xml); rc = virCommandRun(cmd, NULL); cleanup: VIR_FREE(xml); virCommandFree(cmd); return rc; } -- 1.8.1.1

--- src/security/security_selinux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 2affe69..fa2ee57 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -370,14 +370,14 @@ virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr) data->skipAllLabel = true; -#if HAVE_SELINUX_LABEL_H +# if HAVE_SELINUX_LABEL_H data->label_handle = selabel_open(SELABEL_CTX_FILE, NULL, 0); if (!data->label_handle) { virReportSystemError(errno, "%s", _("cannot open SELinux label_handle")); return -1; } -#endif +# endif selinux_conf = virConfReadFile(selinux_lxc_contexts_path(), 0); if (!selinux_conf) { @@ -430,9 +430,9 @@ virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr) return 0; error: -#if HAVE_SELINUX_LABEL_H +# if HAVE_SELINUX_LABEL_H selabel_close(data->label_handle); -#endif +# endif virConfFree(selinux_conf); VIR_FREE(data->domain_context); VIR_FREE(data->file_context); -- 1.8.1.1
participants (1)
-
Jiri Denemark