Skip to content

Commit

Permalink
Check for malloc result done on wrong variable.
Browse files Browse the repository at this point in the history
CID 1255090
  • Loading branch information
stpere committed Jul 1, 2015
1 parent ee1265c commit 2bdea08
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ get_iovec_array(void)

LOCK(iovec_lock);

for(i=0; i < MAX_IOVECS; i++) {
for(i = 0; i < MAX_IOVECS; i++) {
if (iovec_used[i] == 0)
break;
}
Expand All @@ -475,7 +475,7 @@ get_iovec_array(void)

if (iovec_pool[i] == NULL) {
iovec_pool[i] = (struct iovec *)malloc(sizeof(struct iovec)*NUM_FLUSH_BLOCKS);
if (iovec_pool == NULL)
if (iovec_pool[i] == NULL)
beos_panic("can't allocate an iovec!\n");
}

Expand Down

0 comments on commit 2bdea08

Please sign in to comment.