gchar *credentials = NULL;
int credentials_len = 0;
- http_transaction_get_credentials(transaction, &user_name, &password);
+ ret = http_transaction_get_credentials(transaction, &user_name, &password);
+ if (ret != HTTP_ERROR_NONE)
+ return ret;
+
credentials_len = sizeof(gchar) * (strlen(user_name) + 1 + strlen(password) + 1);
credentials = (gchar *)malloc(credentials_len);
if (credentials) {
snprintf(credentials, credentials_len, "%s:%s", (gchar*)user_name, (gchar*)password);
- free(user_name);
- free(password);
http_transaction_get_http_auth_scheme(transaction, &auth_scheme);
}
free(credentials);
}
+ free(user_name);
+ free(password);
}
//LCOV_EXCL_STOP
*password = g_strdup(transaction->password);
if (*password == NULL) {
ERR("strdup is failed\n");
+ g_free(*user_name);
+ *user_name = NULL;
return HTTP_ERROR_OUT_OF_MEMORY;
}
return HTTP_ERROR_NONE;