Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0176a91 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: Avoid null pointer exceptions"

parents ac5e55c1 903ed75f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -573,6 +573,11 @@ int32_t ext_hw_plugin_set_parameters(void *plugin, struct str_parms *parms)
    if(val == AUDIO_HAL_PLUGIN_MSG_CODEC_TUNNEL_CMD ||
        val == AUDIO_HAL_PLUGIN_MSG_CODEC_SET_PP_EQ) {
        kv_pairs = str_parms_to_str(parms);
        if (kv_pairs == NULL) {
            ret = -EINVAL;
            ALOGE("%s: key-value pair is NULL", __func__);
            goto done;
        }
        len = strlen(kv_pairs);
        value = (char*)calloc(len, sizeof(char));
        if (value == NULL) {
@@ -1022,6 +1027,11 @@ int ext_hw_plugin_get_parameters(void *plugin,

    if(val == AUDIO_HAL_PLUGIN_MSG_CODEC_TUNNEL_GET_CMD) {
        kv_pairs = str_parms_to_str(query);
        if (kv_pairs == NULL) {
            ret = -EINVAL;
            ALOGE("%s: key-value pair is NULL", __func__);
            goto done_get_param;
        }
        len = strlen(kv_pairs);
        value = (char*)calloc(len, sizeof(char));
        if (value == NULL) {