Mercurial > audlegacy-plugins
comparison src/scrobbler/plugin.c @ 2929:3868d67e7d19
uninitialized values are bad
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Wed, 20 Aug 2008 18:04:57 +0200 |
parents | ff9b4776b938 |
children | 3134a0987162 |
comparison
equal
deleted
inserted
replaced
2928:c5b7f1d13183 | 2929:3868d67e7d19 |
---|---|
341 } | 341 } |
342 | 342 |
343 void setup_proxy(CURL *curl) | 343 void setup_proxy(CURL *curl) |
344 { | 344 { |
345 mcs_handle_t *db; | 345 mcs_handle_t *db; |
346 gboolean use_proxy; | 346 gboolean use_proxy = FALSE; |
347 | 347 |
348 db = aud_cfg_db_open(); | 348 db = aud_cfg_db_open(); |
349 aud_cfg_db_get_bool(db, NULL, "use_proxy", &use_proxy); | 349 aud_cfg_db_get_bool(db, NULL, "use_proxy", &use_proxy); |
350 if (use_proxy == FALSE) | 350 if (use_proxy == FALSE) |
351 { | 351 { |
352 curl_easy_setopt(curl, CURLOPT_PROXY, ""); | 352 curl_easy_setopt(curl, CURLOPT_PROXY, ""); |
353 } | 353 } |
354 else | 354 else |
355 { | 355 { |
356 gchar *proxy_host, *proxy_port; | 356 gchar *proxy_host = NULL, *proxy_port = NULL; |
357 gboolean proxy_use_auth; | 357 gboolean proxy_use_auth = FALSE; |
358 aud_cfg_db_get_string(db, NULL, "proxy_host", &proxy_host); | 358 aud_cfg_db_get_string(db, NULL, "proxy_host", &proxy_host); |
359 aud_cfg_db_get_string(db, NULL, "proxy_port", &proxy_port); | 359 aud_cfg_db_get_string(db, NULL, "proxy_port", &proxy_port); |
360 curl_easy_setopt(curl, CURLOPT_PROXY, proxy_host); | 360 curl_easy_setopt(curl, CURLOPT_PROXY, proxy_host); |
361 curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxy_port); | 361 curl_easy_setopt(curl, CURLOPT_PROXYPORT, proxy_port); |
362 aud_cfg_db_get_bool(db, NULL, "proxy_use_auth", &proxy_use_auth); | 362 aud_cfg_db_get_bool(db, NULL, "proxy_use_auth", &proxy_use_auth); |
363 if (proxy_use_auth != FALSE) | 363 if (proxy_use_auth != FALSE) |
364 { | 364 { |
365 gchar *userpwd, *user, *pass; | 365 gchar *userpwd = NULL, *user = NULL, *pass = NULL; |
366 aud_cfg_db_get_string(db, NULL, "proxy_user", &user); | 366 aud_cfg_db_get_string(db, NULL, "proxy_user", &user); |
367 aud_cfg_db_get_string(db, NULL, "proxy_pass", &pass); | 367 aud_cfg_db_get_string(db, NULL, "proxy_pass", &pass); |
368 userpwd = g_strdup_printf("%s:%s", user, pass); | 368 userpwd = g_strdup_printf("%s:%s", user, pass); |
369 curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, userpwd); | 369 curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, userpwd); |
370 g_free(userpwd); | 370 g_free(userpwd); |