Revision 69d4c703 linux-user/syscall.c
b/linux-user/syscall.c | ||
---|---|---|
2430 | 2430 |
nsems = semid_ds.sem_nsems; |
2431 | 2431 |
|
2432 | 2432 |
*host_array = malloc(nsems*sizeof(unsigned short)); |
2433 |
if (!*host_array) { |
|
2434 |
return -TARGET_ENOMEM; |
|
2435 |
} |
|
2433 | 2436 |
array = lock_user(VERIFY_READ, target_addr, |
2434 | 2437 |
nsems*sizeof(unsigned short), 1); |
2435 |
if (!array) |
|
2438 |
if (!array) { |
|
2439 |
free(*host_array); |
|
2436 | 2440 |
return -TARGET_EFAULT; |
2441 |
} |
|
2437 | 2442 |
|
2438 | 2443 |
for(i=0; i<nsems; i++) { |
2439 | 2444 |
__get_user((*host_array)[i], &array[i]); |
Also available in: Unified diff