Hi Andrzej,

ofono-boun...@ofono.org wrote:
> +static void at_discover_apps_cb(gboolean ok, GAtResult *result,
> +                             gpointer user_data) +{
> +     struct cb_data *cbd = user_data;
> +     GAtResultIter iter;
> +     ofono_sim_list_apps_cb_t cb = cbd->cb;
> +     struct ofono_error error;
> +     const unsigned char *dataobj;
> +     gint linelen;
> +     unsigned char *buffer;
> +     int len;
> +
> +     decode_at_error(&error, g_at_result_final_response(result)); +
> +     if (!ok) {
> +             cb(&error, NULL, 0, cbd->data);
> +             return;
> +     }
> +
> +     g_at_result_iter_init(&iter, result);
> +
> +     len = 0;
> +     while (g_at_result_iter_next(&iter, "+CUAD:")) {
> +             if (!g_at_result_iter_next_hexstring(&iter,
> NULL, &linelen))
> +                     goto error;
> +
> +             len += linelen;
> +     }
> +
> +     g_at_result_iter_init(&iter, result);
> +
> +     buffer = g_malloc(len);
> +     len = 0;
> +     while (g_at_result_iter_next(&iter, "+CUAD:")) {
> +             g_at_result_iter_next_hexstring(&iter,
> &dataobj, &linelen);
> +             memcpy(buffer + len, dataobj, linelen);
> +             len += linelen;
> +     }

missing check for buffer memory allocation failure 

> +
> +static int at_sim_auth_probe(struct ofono_sim_auth *sa,
> unsigned int vendor,
> +                             void *data)
> +{
> +     GAtChat *chat = data;
> +     struct sim_auth_data *sad;
> +
> +     sad = g_new0(struct sim_auth_data, 1);
> +     sad->chat = g_at_chat_clone(chat);
> +     sad->vendor = vendor;

missing check for "sad" memory allocation failure 

Regards,
Jeevaka
_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to