aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarod Wilson <jwilson@redhat.com>2007-10-24 16:50:24 -0400
committerKristian Høgsberg <krh@redhat.com>2007-10-24 16:50:24 -0400
commit8085c633bce9fed1a74dd2037d7f3a95f839a4e2 (patch)
treeb6aadd9b3340ee8eaab94fa56c3998da4457c580
parent78a77758c766142bb02dcc02a8aab7c331202b45 (diff)
downloadlibraw1394-8085c633bce9fed1a74dd2037d7f3a95f839a4e2.tar.gz
Set handle->iso.packets to NULL after freeing to avoid double-frees.
-rw-r--r--juju/raw1394-iso.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/juju/raw1394-iso.c b/juju/raw1394-iso.c
index b1e493c..ae8aaad 100644
--- a/juju/raw1394-iso.c
+++ b/juju/raw1394-iso.c
@@ -389,6 +389,7 @@ iso_init(raw1394handle_t handle, int type,
handle->iso.fd = open(handle->local_filename, O_RDWR);
if (handle->iso.fd < 0) {
free(handle->iso.packets);
+ handle->iso.packets = NULL;
return -1;
}
@@ -399,6 +400,7 @@ iso_init(raw1394handle_t handle, int type,
handle->iso.fd, &ep) < 0) {
close(handle->iso.fd);
free(handle->iso.packets);
+ handle->iso.packets = NULL;
return -1;
}
@@ -412,6 +414,7 @@ iso_init(raw1394handle_t handle, int type,
if (retval < 0) {
close(handle->iso.fd);
free(handle->iso.packets);
+ handle->iso.packets = NULL;
return retval;
}
@@ -422,6 +425,7 @@ iso_init(raw1394handle_t handle, int type,
if (handle->iso.buffer == MAP_FAILED) {
close(handle->iso.fd);
free(handle->iso.packets);
+ handle->iso.packets = NULL;
return -1;
}
@@ -514,4 +518,5 @@ void raw1394_iso_shutdown(raw1394handle_t handle)
handle->iso.buf_packets * handle->iso.max_packet_size);
close(handle->iso.fd);
free(handle->iso.packets);
+ handle->iso.packets = NULL;
}