Ignore:
Timestamp:
2010-10-27T20:52:47Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
09d5ec8
Parents:
d2b1040
Message:

Do not leak memory buffers due ERROR_PROPAGATE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/measured_strings.c

    rd2b1040 rf4c8a83f  
    187187                                return EINVAL;
    188188                        }
    189                         ERROR_PROPAGATE(async_data_write_finalize(callid, next,
    190                             lengths[index]));
     189                        if (ERROR_OCCURRED(async_data_write_finalize(callid,
     190                            next, lengths[index]))) {
     191                                free(*data);
     192                                free(*strings);
     193                                free(lengths);
     194                                return ERROR_CODE;
     195                        }
    191196                        (*strings)[index].value = next;
    192197                        next += lengths[index];
     
    345350                (*strings)[index].length = lengths[index];
    346351                if (lengths[index] > 0) {
    347                         ERROR_PROPAGATE(async_data_read_start(phone, next,
    348                             lengths[index]));
     352                        if (ERROR_OCCURRED(async_data_read_start(phone, next,
     353                            lengths[index]))) {
     354                                free(lengths);
     355                                free(data);
     356                                free(strings);
     357                                return ERROR_CODE;
     358                        }
    349359                        (*strings)[index].value = next;
    350360                        next += lengths[index];
Note: See TracChangeset for help on using the changeset viewer.