Changeset a6480d5 in mainline for uspace/app/bdsh/input.c


Ignore:
Timestamp:
2011-08-21T11:44:59Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
25c1b2c, bd5f3b7, d1e196f7
Parents:
c22531fc (diff), 1877128 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Martin Sucha <> (2011-08-21 11:44:59)
git-committer:
Martin Decky <martin@…> (2011-08-21 11:44:59)
Message:

merge Martin Sucha's fixes and improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    rc22531fc ra6480d5  
    6868{
    6969        char *cmd[WORD_MAX];
    70         token_t tokens_space[WORD_MAX];
    71         token_t *tokens = tokens_space;
     70        token_t *tokens = calloc(WORD_MAX, sizeof(token_t));
     71        if (tokens == NULL)
     72                return ENOMEM;
    7273        int rc = 0;
    7374        tokenizer_t tok;
     
    7778        char *redir_to = NULL;
    7879
    79         if (NULL == usr->line)
     80        if (NULL == usr->line) {
     81                free(tokens);
    8082                return CL_EFAIL;
     83        }
    8184
    8285        rc = tok_init(&tok, usr->line, tokens, WORD_MAX);
     
    209212        }
    210213        tok_fini(&tok);
     214        free(tokens);
    211215
    212216        return rc;
Note: See TracChangeset for help on using the changeset viewer.