Ignore:
Timestamp:
2012-02-18T15:22:14Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
00aece0, a7d6185, ec8c622
Parents:
c01bb5f9
Message:

Do not leak memory in the root driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/infrastructure/root/root.c

    rc01bb5f9 rf943dd3  
    158158        if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) {
    159159                ddf_msg(LVL_ERROR, "Memory allocation failed.");
    160                 return ENOMEM;
    161         }
     160                free(platform);
     161                return ENOMEM;
     162        }
     163
     164        free(platform);
    162165
    163166        /* Add function. */
     
    169172        if (fun == NULL) {
    170173                ddf_msg(LVL_ERROR, "Error creating function %s", name);
     174                free(match_id);
    171175                return ENOMEM;
    172176        }
     
    176180                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    177181                    name);
     182                free(match_id);
    178183                ddf_fun_destroy(fun);
    179184                return rc;
     
    208213         * vital for the system.
    209214         */
    210         add_virtual_root_fun(dev);
     215        (void) add_virtual_root_fun(dev);
    211216
    212217        /* Register root device's children. */
Note: See TracChangeset for help on using the changeset viewer.