soc.2009.transport: 7beacfd2: Fixed memleak with GError

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Fri Jul 24 06:51:16 EDT 2009


-----------------------------------------------------------------
Revision: 7beacfd228068bfddfb7eee062286c10d84254fe
Ancestor: b9d725cbf0498969e23e08656a9375764b688e04
Author: hanzz at soc.pidgin.im
Date: 2009-07-24T08:08:09
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/7beacfd228068bfddfb7eee062286c10d84254fe

Modified files:
        main.cpp registerhandler.cpp

ChangeLog: 

Fixed memleak with GError

-------------- next part --------------
============================================================
--- main.cpp	2601fa1bc298e8f28030dd71cdb75cf5f5cc0b13
+++ main.cpp	3170f758221e5378ac6de4e38760ea4fb7c83a80
@@ -802,17 +802,18 @@ void GlooxMessageHandler::loadConfigFile
 void GlooxMessageHandler::loadConfigFile(const std::string &config){
 	GKeyFile *keyfile;
 	int flags;
-	GError *error = NULL;
   	char **bind;
 	int i;
 	
 	keyfile = g_key_file_new ();
 	flags = G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS;
 	
-	if (!g_key_file_load_from_file (keyfile, config.c_str(), (GKeyFileFlags)flags, &error)) {
-		if (!g_key_file_load_from_file (keyfile, std::string("/etc/highflyer/" + config + ".cfg").c_str(), (GKeyFileFlags)flags, &error))
+	if (!g_key_file_load_from_file (keyfile, config.c_str(), (GKeyFileFlags)flags, NULL)) {
+		if (!g_key_file_load_from_file (keyfile, std::string("/etc/highflyer/" + config + ".cfg").c_str(), (GKeyFileFlags)flags, NULL))
 		{
-			Log().Get("gloox") << "Can't load config file!!!";
+			Log().Get("gloox") << "Can't load config file!";
+			Log().Get("gloox") << std::string("/etc/highflyer/" + config + ".cfg") << " or ./" << config;
+			
 			g_key_file_free(keyfile);
 			exit(0);
 			return;
============================================================
--- registerhandler.cpp	3ed3247cda8ca8ef1c2ac08555c8c4ef71f0ba6c
+++ registerhandler.cpp	48e712077e5a807376095ee87c9cc3e5b7ff1725
@@ -311,22 +311,7 @@ bool GlooxRegisterHandler::handleIq (con
 
 
 		UserRow res = p->sql()->getUserByJid(iq.from().bare());
-		if(res.id==-1) {
-	
-// 			if(false) {
-// 			XDEBUG(( "User already exists .. :( \n" ));
-// 			Stanza *r = new Stanza(stanza);//->clone();
-// 			Tag *error = new Tag("error");
-// 			error->addAttribute( "code", "409" );
-// 			error->addAttribute( "type", "cancel" );
-// 			Tag *conflict = new Tag("conflict");
-// 			conflict->addAttribute( "xmlns", "urn:ietf:params:xml:ns:xmpp-stanzas" );
-// 			conflict->setCData( "Someone else already registered with this xfire username (" + user->jid + ")" );
-// 			error->addChild( conflict );
-// 			r->addChild( error );
-// 			comp->j->send( r );
-// 		} else {
-	
+		if(res.id==-1) {	
 			std::cout << "* adding new user: "<< jid << ", " << username << ", " << password << ", " << language <<"\n";
 			p->sql()->addUser(jid,username,password,language);
 			sendsubscribe = true;


More information about the Commits mailing list