aboutsummaryrefslogtreecommitdiff
path: root/lib/io
diff options
context:
space:
mode:
Diffstat (limited to 'lib/io')
-rw-r--r--lib/io/compress/ostream_compressor.c4
-rw-r--r--lib/io/uncompress/istream_compressor.c4
-rw-r--r--lib/io/unix/ostream.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/io/compress/ostream_compressor.c b/lib/io/compress/ostream_compressor.c
index f63a3d2..a5f16d5 100644
--- a/lib/io/compress/ostream_compressor.c
+++ b/lib/io/compress/ostream_compressor.c
@@ -56,7 +56,7 @@ static void comp_destroy(sqfs_object_t *obj)
ostream_comp_t *comp = (ostream_comp_t *)obj;
comp->cleanup(comp);
- sqfs_destroy(comp->wrapped);
+ sqfs_drop(comp->wrapped);
free(comp);
}
@@ -95,7 +95,7 @@ ostream_t *ostream_compressor_create(ostream_t *strm, int comp_id)
sqfs_object_init(comp, comp_destroy, NULL);
- comp->wrapped = strm;
+ comp->wrapped = sqfs_grab(strm);
comp->inbuf_used = 0;
base = (ostream_t *)comp;
diff --git a/lib/io/uncompress/istream_compressor.c b/lib/io/uncompress/istream_compressor.c
index 1c73e3a..d4e1aea 100644
--- a/lib/io/uncompress/istream_compressor.c
+++ b/lib/io/uncompress/istream_compressor.c
@@ -18,7 +18,7 @@ static void comp_destroy(sqfs_object_t *obj)
istream_comp_t *comp = (istream_comp_t *)obj;
comp->cleanup(comp);
- sqfs_destroy(comp->wrapped);
+ sqfs_drop(comp->wrapped);
free(comp);
}
@@ -57,7 +57,7 @@ istream_t *istream_compressor_create(istream_t *strm, int comp_id)
sqfs_object_init(comp, comp_destroy, NULL);
- comp->wrapped = strm;
+ comp->wrapped = sqfs_grab(strm);
base = (istream_t *)comp;
base->get_filename = comp_get_filename;
diff --git a/lib/io/unix/ostream.c b/lib/io/unix/ostream.c
index 6ed18e6..5ef2af2 100644
--- a/lib/io/unix/ostream.c
+++ b/lib/io/unix/ostream.c
@@ -163,6 +163,8 @@ ostream_t *ostream_open_stdout(void)
strm->append = file_append;
strm->flush = file_flush;
strm->get_filename = file_get_filename;
+
+ sqfs_object_init(file, file_destroy, NULL);
return strm;
fail:
perror("creating file wrapper for stdout");