diff options
Diffstat (limited to 'src/map/pc_groups.c')
-rw-r--r-- | src/map/pc_groups.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index 2fd143b53..42a068693 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -14,7 +14,6 @@ #include "pc_groups.h" #include "pc.h" // e_pc_permission - typedef struct GroupSettings GroupSettings; // Cached config settings/pointers for quick lookup @@ -278,16 +277,18 @@ static void read_config(void) { if( ( pc_group_max = group_count ) ) { DBIterator *iter = db_iterator(pc_group_db); GroupSettings *group_settings = NULL; - int* group_ids = aMalloc( pc_group_max * sizeof(int) ); + unsigned int* group_ids = aMalloc( pc_group_max * sizeof(unsigned int) ); int i = 0; for (group_settings = dbi_first(iter); dbi_exists(iter); group_settings = dbi_next(iter)) { group_ids[i++] = group_settings->id; } - atcommand->load_groups(group_ids); - - aFree(group_ids); + if( atcommand->group_ids ) + aFree(atcommand->group_ids); + atcommand->group_ids = group_ids; + atcommand->load_groups(); + dbi_destroy(iter); } |