comparison pidgin-twitter.c @ 212:8670e1572be8

fix for a bug that apply_filter() would crash if both sender and buffer have been cleared.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 25 Aug 2008 21:37:09 +0900
parents e13103257b33
children 148fa8a8be8e
comparison
equal deleted inserted replaced
211:e13103257b33 212:8670e1572be8
1514 { 1514 {
1515 GMatchInfo *match_info; 1515 GMatchInfo *match_info;
1516 const gchar *list = NULL; 1516 const gchar *list = NULL;
1517 gchar **candidates = NULL, **candidate = NULL; 1517 gchar **candidates = NULL, **candidate = NULL;
1518 1518
1519 g_return_if_fail(*sender != NULL);
1520 g_return_if_fail(*buffer != NULL);
1521
1519 gchar *plain = strip_html_markup(*buffer); 1522 gchar *plain = strip_html_markup(*buffer);
1520 1523
1521 switch(service) { 1524 switch(service) {
1522 case twitter_service: 1525 case twitter_service:
1523 list = purple_prefs_get_string(OPT_FILTER_TWITTER); 1526 list = purple_prefs_get_string(OPT_FILTER_TWITTER);
1555 g_free(*buffer); *buffer = NULL; 1558 g_free(*buffer); *buffer = NULL;
1556 #endif 1559 #endif
1557 break; 1560 break;
1558 } 1561 }
1559 } 1562 }
1563
1560 g_free(user); 1564 g_free(user);
1561 g_match_info_next(match_info, NULL); 1565 g_match_info_next(match_info, NULL);
1562 } 1566 }
1563 g_free(plain); 1567 g_free(plain);
1564 g_strfreev(candidates); 1568 g_strfreev(candidates);