Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 485dacd in mainline for uspace/lib/drv/generic/remote_ahci.c


Ignore:
Timestamp:
2016-03-16T16:24:40Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
4c5deac
Parents:
d9ffc54
git-author:
Manuele Conti <conti.manuele@…> (2016-03-16 16:24:40)
git-committer:
Jakub Jermar <jakub@…> (2016-03-16 16:24:40)
Message:

Test and free buffer returned by malloc() in remote_ahci_get_sata_device_name()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_ahci.c

    rd9ffc54 r485dacd  
    222222       
    223223        char* sata_dev_name = malloc(sata_dev_name_length);
    224        
     224        if (sata_dev_name == NULL) {
     225                async_answer_0(callid, ENOMEM);
     226                return;
     227        }       
     228
    225229        const int ret = ahci_iface->get_sata_device_name(fun,
    226230            sata_dev_name_length, sata_dev_name);
     
    231235            (real_size == sata_dev_name_length))
    232236                async_data_read_finalize(cid, sata_dev_name, sata_dev_name_length);
    233        
     237
     238        free(sata_dev_name);
    234239        async_answer_0(callid, ret);
    235240}
Note: See TracChangeset for help on using the changeset viewer.