Changeset - fa1b56538545
[Not reviewed]
0 1 0
Jan Kaluza - 13 years ago 2012-03-07 10:47:46
hanzz.k@gmail.com
Use g_free for freeing glibs data
1 file changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/main.cpp
Show inline comments
 
@@ -89,7 +89,7 @@ static std::string KEYFILE_STRING(const std::string &cat, const std::string &key
 
		return def;
 
	}
 
	std::string ret(str);
 
	free(str);
 
	g_free(str);
 

	
 
	if (ret.find("#") != std::string::npos) {
 
		ret = ret.substr(0, ret.find("#"));
 
@@ -1407,11 +1407,13 @@ static void *notify_user_info(PurpleConnection *gc, const char *who, PurpleNotif
 
			if (true) {
 
				gchar *data;
 
				gchar *path = purple_buddy_icon_get_full_path(icon);
 
				if (g_file_get_contents (path, &data, &len, NULL)) {
 
					photo = std::string(data, len);
 
					free(data);
 
				if (path) {
 
					if (g_file_get_contents(path, &data, &len, NULL)) {
 
						photo = std::string(data, len);
 
						g_free(data);
 
					}
 
					g_free(path);
 
				}
 
				free(path);
 
			}
 
			else {
 
				const gchar * data = (gchar*)purple_buddy_icon_get_data(icon, &len);
0 comments (0 inline, 0 general)