Skip to content

Commit

Permalink
Fixed a memleak introduced in the last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeusz Sośnierz committed Jun 27, 2010
1 parent 1ba79c5 commit 771f874
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ui_roster.c
Expand Up @@ -288,8 +288,12 @@ ui_roster_add(const gchar *j, const gchar *n, const gchar *g)
UiGroup *group;
GSList *elem;
/* checking if our buddy belongs to some group */
if (g == NULL)
g = g_strdup("general");
if (g == NULL) {
/* that looks a bit ugly, yet saves us some dynamic
* memory allocation crap */
char buf[] = "general";
g = buf;
}
/* looking for his group */
for(elem = groups; elem; elem = elem->next) {
group = (UiGroup *)elem->data;
Expand Down

0 comments on commit 771f874

Please sign in to comment.