mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 13:46:21 +00:00
Set prof_ident to NULL after free
This caused the bug mentioned in the PR comment:
```
It seems with the changes done here we get a crash in: src/xmpp/message.c message_handlers_init() when looking up handlers: ProfMessageHandler *handler = g_hash_table_lookup(pubsub_event_handlers, curr->data);.
Steps to reproduce:
open Profanity and connect
/autoping set 10
/autoping timeout 10
stop WiFi/connection
wait for Lost connection
restart wifi
/connect
```
This commit is contained in:
@@ -247,6 +247,7 @@ connection_disconnect(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
free(prof_identifier);
|
free(prof_identifier);
|
||||||
|
prof_identifier = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -681,7 +682,7 @@ static void _compute_identifier(const char *barejid)
|
|||||||
assert(b64 != NULL);
|
assert(b64 != NULL);
|
||||||
g_free(hmac);
|
g_free(hmac);
|
||||||
|
|
||||||
//in case of reconnect
|
//in case of reconnect (lost connection)
|
||||||
free(prof_identifier);
|
free(prof_identifier);
|
||||||
|
|
||||||
prof_identifier = b64;
|
prof_identifier = b64;
|
||||||
|
|||||||
Reference in New Issue
Block a user