Permalink
Browse files

free() infostr after use.

  • Loading branch information...
1 parent a0ae81f commit dd32789bcef5a37abf23b7ab829edebb8bf39375 @michaelfoster michaelfoster committed Apr 6, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 plg/ui/ui.c
View
@@ -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]);
}

0 comments on commit dd32789

Please sign in to comment.