Changeset a4fc367 in mainline


Ignore:
Timestamp:
2006-05-14T09:28:02Z (19 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2be27868
Parents:
6326f5e6
Message:

memory deallocation fix in sysinfo syscall handlers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/sysinfo/sysinfo.c

    r6326f5e6 ra4fc367  
    257257        str=malloc(len+1,0);
    258258        ASSERT(str);
    259         if(copy_from_uspace(str,(void *)ptr,len+1)) return 0;
    260         if(str[len]) return 0;          /*This is not len lenght C string*/
    261         ret=sysinfo_get_val(str,NULL);
     259        if(!((copy_from_uspace(str,(void *)ptr,len+1))||(str[len])))
     260                ret=sysinfo_get_val(str,NULL);
    262261        free(str);
    263262        return ret.valid;
     
    270269        str=malloc(len+1,0);
    271270        ASSERT(str);
    272         if(copy_from_uspace(str,(void *)ptr,len+1)) return 0;
    273         if(str[len]) return 0;          /*This is not len lenght C string*/
    274         ret=sysinfo_get_val(str,NULL);
     271        if(!((copy_from_uspace(str,(void *)ptr,len+1))||(str[len])))
     272                ret=sysinfo_get_val(str,NULL);
    275273        free(str);
    276274        return ret.val;
Note: See TracChangeset for help on using the changeset viewer.