[PATCH 10/30] util: convert pointers to use g_autofree
Ján Tomko
jtomko at redhat.com
Tue Nov 24 11:59:24 UTC 2020
On a Monday in 2020, Ryan Gahagan wrote:
>From: Barrett Schonefeld <bschoney at utexas.edu>
>
>- src/util/virrotatingfile.c
>
>Signed-off-by: Barrett Schonefeld <bschoney at utexas.edu>
>---
> src/util/virrotatingfile.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c
>index 9f1ef17c3e..6d8076e7c4 100644
>--- a/src/util/virrotatingfile.c
>+++ b/src/util/virrotatingfile.c
>@@ -362,8 +362,8 @@ static int
> virRotatingFileWriterRollover(virRotatingFileWriterPtr file)
> {
> size_t i;
>- char *nextpath = NULL;
>- char *thispath = NULL;
>+ g_autofree char *nextpath = NULL;
>+ g_autofree char *thispath = NULL;
> int ret = -1;
>
> VIR_DEBUG("Rollover %s", file->basepath);
>@@ -403,8 +403,6 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file)
>
> ret = 0;
> cleanup:
>- VIR_FREE(nextpath);
nextpath is also freed in the loop, but here we need to preserve its
value across iterations.
I'd rather leave it uncoverted.
Jano
>- VIR_FREE(thispath);
> return ret;
> }
>
>--
>2.29.0
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20201124/dec15523/attachment-0001.sig>
More information about the libvir-list
mailing list