Comment 2 for bug 1990903

Revision history for this message
Konstantin (list-kseiler) wrote :

I did some debugging and found the reason for the crash: an array is attempted to be freed even though it could be NULL.

Below is the code fragment with the missing if-statenment inserted.

In auth-dialog/main.c around line 720:

function static void cookie_cb (GObject *source_obj, GAsyncResult *res, gpointer data):
[...]
    for (i = 0; i < 2 * (num_cookies + 1); i++) {
        free(cookie_array[i]);
    }
    free(cookie_array);

    if (headers_array) { // <=========== THIS LINE IS MISSING AND MUST BE ADDED
        for (i = 0; i < 2 * (num_headers + 1); i++) {
            free(headers_array[i]);
        }
        free(headers_array);
    } // <=========== THIS LINE IS MISSING AND MUST BE ADDED
    if (headers)
        soup_message_headers_free (headers);