[libglnx] glnx-fdio: always initialize buf



commit cf8ae27bab717621f1edf8ab6ae3dd89da4d8d4f
Author: Giuseppe Scrivano <gscrivan redhat com>
Date:   Tue May 5 16:37:24 2015 +0200

    glnx-fdio: always initialize buf
    
    It can be used without initialization if condition causing a "goto
    error" fails before buf is initialized.
    
    Signed-off-by: Giuseppe Scrivano <gscrivan redhat com>

 glnx-fdio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/glnx-fdio.c b/glnx-fdio.c
index 517f1e5..7db33c4 100644
--- a/glnx-fdio.c
+++ b/glnx-fdio.c
@@ -211,7 +211,7 @@ glnx_file_get_contents_utf8_at (int                   dfd,
 {
   gboolean success = FALSE;
   glnx_fd_close int fd = -1;
-  char *buf;
+  char *buf = NULL;
   gsize len;
 
   dfd = glnx_dirfd_canonicalize (dfd);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]