diff --git a/glnx-fdio.c b/glnx-fdio.c
index 517f1e541661a33d5c226f674e3ca2701ab111c0..7db33c4c61e45ef7ed105bde15d10296047c18fa 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);