Use glib for allocations in all plugins

Continuation of 83032b1aa
This commit is contained in:
TingPing
2014-12-28 06:08:20 -05:00
parent 83032b1aa3
commit 3f855f07f5
26 changed files with 118 additions and 257 deletions

View File

@ -29,7 +29,6 @@
#include <string.h>
#include "irc.h"
#include "fish.h"
#include "misc.h"
#include "keystore.h"
#include "plugin_hexchat.h"
@ -97,7 +96,7 @@ char *keystore_get_key(const char *nick) {
if (strncmp(value, "+OK ", 4) != 0) {
// Key is stored in plaintext
return import_glib_string(value);
return value;
} else {
// Key is encrypted
const char *encrypted = value+4;
@ -191,7 +190,7 @@ bool keystore_store_key(const char *nick, const char *key) {
// Store encrypted in file
g_key_file_set_string(keyfile, nick, "key", wrapped);
free(wrapped);
g_free(wrapped);
} else {
// Store unencrypted in file
g_key_file_set_string(keyfile, nick, "key", key);
@ -220,11 +219,3 @@ bool keystore_delete_nick(const char *nick) {
g_key_file_free(keyfile);
return ok;
}
void keystore_secure_free(void *ptr, size_t size) {
secure_erase(ptr, size);
free(ptr);
}