summaryrefslogtreecommitdiffstats
path: root/src/fw-iso.c
diff options
context:
space:
mode:
authorGravatar Stefan Richter 2010-06-05 14:55:53 +0200
committerGravatar Stefan Richter 2010-09-07 11:18:05 +0200
commit9d47becf251d8601e834e777d6f7f10eb62ec8dc (patch)
treeb4456c1c530787eda26ed71d784efdc4aca9f8c3 /src/fw-iso.c
parentFix for overlooked device HUP with 'firewire' stack (diff)
Add missing malloc failure checks
Also add errno = ENOMEM because it is said that that some malloc implementations might miss to do so. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to '')
-rw-r--r--src/fw-iso.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fw-iso.c b/src/fw-iso.c
index 88909dc..5aac9fe 100644
--- a/src/fw-iso.c
+++ b/src/fw-iso.c
@@ -463,8 +463,10 @@ iso_init(fw_handle_t handle, int type,
handle->iso.packet_count = 0;
handle->iso.packets =
malloc(handle->iso.irq_interval * sizeof handle->iso.packets[0]);
- if (handle->iso.packets == NULL)
+ if (handle->iso.packets == NULL) {
+ errno = ENOMEM;
return -1;
+ }
handle->iso.fd = open(handle->iso.filename, O_RDWR);
if (handle->iso.fd < 0) {