cut, uudecode: free buf after use
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
This commit is contained in:
parent
2dbb694932
commit
daad071b31
5
cut.c
5
cut.c
@ -96,8 +96,8 @@ seek(const char *s, size_t pos, size_t *prev, size_t count)
|
|||||||
static void
|
static void
|
||||||
cut(FILE *fp)
|
cut(FILE *fp)
|
||||||
{
|
{
|
||||||
static char *buf = NULL;
|
char *buf = NULL;
|
||||||
static size_t size = 0;
|
size_t size = 0;
|
||||||
char *s;
|
char *s;
|
||||||
size_t i, n, p;
|
size_t i, n, p;
|
||||||
Range *r;
|
Range *r;
|
||||||
@ -123,6 +123,7 @@ cut(FILE *fp)
|
|||||||
}
|
}
|
||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -173,4 +173,5 @@ uudecode(FILE *fp, FILE *outfp)
|
|||||||
afgets(&bufb, &n, fp);
|
afgets(&bufb, &n, fp);
|
||||||
if (strnlen(bufb, 3) < 3 || strncmp(bufb, "end", 3) != 0 || bufb[3] != '\n')
|
if (strnlen(bufb, 3) < 3 || strncmp(bufb, "end", 3) != 0 || bufb[3] != '\n')
|
||||||
eprintf("invalid uudecode footer \"end\" not found\n");
|
eprintf("invalid uudecode footer \"end\" not found\n");
|
||||||
|
free(bufb);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user