Commit Diff


commit - e79f468ebe7a3161f90c560a639c9e2236f529b7
commit + 60507209f36a328d692ef6a40e64b8b4d6137c04
blob - 883c138847c11a22bc4a38479cc6b052ff964509
blob + 8dafd2fbb8e77a084aedc190a6af38bf5dc4b5c2
--- got/Makefile
+++ got/Makefile
@@ -17,7 +17,7 @@ DEBUG = -O0 -pg
 DEBUG = -O0 -g
 .endif
 CFLAGS += -Werror -Wall -Wstrict-prototypes -Wunused-variable
-#CFLAGS += -DGOT_PACK_NO_MMAP
+CFLAGS += -DGOT_PACK_NO_MMAP
 #CFLAGS += -DGOT_NO_OBJ_CACHE
 
 # For now, default to installing binary in ~/bin
blob - 89c49ef2aabd9550a244a7e724def3014b1fc8d9
blob + 75303da7dbe23c446853834f3000f506c4af09e7
--- lib/inflate.c
+++ lib/inflate.c
@@ -301,8 +301,11 @@ got_inflate_to_mem_mmap(uint8_t **outbuf, size_t *outl
 	if (*outbuf == NULL)
 		return got_error_from_errno();
 	err = got_inflate_init(&zb, *outbuf, GOT_ZSTREAM_BUFSIZE);
-	if (err)
+	if (err) {
+		free(*outbuf);
+		*outbuf = NULL;
 		return err;
+	}
 
 	*outlen = 0;