Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/stdio/scanf.c

    r12fb8498 ra12f7f1  
    303303        self->fetched = 0;
    304304        self->cursor = NULL;
    305         free(self->window);
    306         self->window = NULL;
     305        if (self->window) {
     306                free(self->window);
     307                self->window = NULL;
     308        }
    307309        self->window_size = 0;
    308310        self->state = _PROV_CONSTRUCTED;
     
    653655                                /* Update the cursor so it can be returned to the provider. */
    654656                                cur_borrowed += cur_updated - cur_limited;
    655                                 if (width != -1) {
     657                                if (width != -1 && cur_limited != NULL) {
    656658                                        /* Deallocate duplicated part of the cursor view. */
    657659                                        free(cur_limited);
     
    833835                                /* Update the cursor so it can be returned to the provider. */
    834836                                cur_borrowed += cur_updated - cur_limited;
    835                                 if (width != -1) {
     837                                if (width != -1 && cur_limited != NULL) {
    836838                                        /* Deallocate duplicated part of the cursor view. */
    837839                                        free(cur_limited);
Note: See TracChangeset for help on using the changeset viewer.