[prev in list] [next in list] [prev in thread] [next in thread]
List: libvir-list
Subject: Re: [libvirt PATCH] tests: refactor testSELinuxLoadDef
From: Michal Prívozník <mprivozn () redhat ! com>
Date: 2022-01-31 16:42:15
Message-ID: 32a54dcb-c1da-c102-47ed-6fa35dc1e7ac () redhat ! com
[Download RAW message or body]
On 1/28/22 19:41, Ján Tomko wrote:
> Since its introduction in
> commit 907a39e735d256b8428ed4c77009d1f713aea19b
> Add a test suite for validating SELinux labelling
>
> this function did not return NULL on OOM.
>
> Since we abort on OOM now, switch testSELinuxMungePath to void,
> return NULL explicitly on XML parsing failure and remove
> the (now pointless) cleanup label.
>
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
> tests/securityselinuxlabeltest.c | 35 +++++++++++---------------------
> 1 file changed, 12 insertions(+), 23 deletions(-)
>
> diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
> index 09902e1c54..b62162fe9f 100644
> --- a/tests/securityselinuxlabeltest.c
> +++ b/tests/securityselinuxlabeltest.c
> @@ -82,16 +82,12 @@ testUserXattrEnabled(void)
> return ret;
> }
>
> -static int
> +static void
> testSELinuxMungePath(char **path)
> {
> - char *tmp;
> -
> - tmp = g_strdup_printf("%s/securityselinuxlabeldata%s", abs_builddir, *path);
> -
> - VIR_FREE(*path);
> + char *tmp = g_strdup_printf("%s/securityselinuxlabeldata%s", abs_builddir, *path);
> + g_free(*path);
> *path = tmp;
> - return 0;
nitpick: please keep that empty line between variable declaration block
and code block.
> }
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Michal
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic