Skip to content

Commit

Permalink
free() infostr after use.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfoster committed Apr 6, 2012
1 parent a0ae81f commit dd32789
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plg/ui/ui.c
Expand Up @@ -21,10 +21,11 @@ static void cd(char *line, char **caps, int ncaps)
if (ncaps > 1 && *caps[1])
info("cd: must have one argument");

char *infostr = malloc(17 + strlen(caps[0]));
char *infostr = malloc(16 + strlen(caps[0]));
strcpy(infostr, "now talking on ");
strcat(infostr, caps[0]);
info(infostr);
free(infostr);

strcpy(chan, caps[0]);
}
Expand Down

0 comments on commit dd32789

Please sign in to comment.