uxc.c: fix coverity resource leak warning
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sun, 22 Aug 2021 08:46:03 +0000 (09:46 +0100)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sun, 22 Aug 2021 08:46:03 +0000 (09:46 +0100)
707 blob_buf_free(&req);
708
   CID 1490412:    (RESOURCE_LEAK)
   Handle variable "f" going out of scope leaks the handle.
709 return 0;

Add a close before we return

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
uxc.c

diff --git a/uxc.c b/uxc.c
index 5163b9a3e265e97c361c6d90f30a370fa8103658..722176370de7ea0e8ef808520581471da28e4019 100644 (file)
--- a/uxc.c
+++ b/uxc.c
@@ -705,6 +705,7 @@ static int uxc_set(char *name, char *path, bool autostart, bool add, char *pidfi
        }
 
        blob_buf_free(&req);
+       close(f);
 
        return 0;
 }