From 20a149b2c7bfd7e53d24d0665281c083d7362c67 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 12 Oct 2007 00:01:33 +0000 Subject: malloc over fatty buffers --- src/librc-depend.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/librc-depend.c') diff --git a/src/librc-depend.c b/src/librc-depend.c index 62ceaac7..c00f4fa8 100644 --- a/src/librc-depend.c +++ b/src/librc-depend.c @@ -667,7 +667,7 @@ bool rc_deptree_update (void) rc_deptype_t *deptype = NULL; rc_deptype_t *dt; rc_deptype_t *last_deptype = NULL; - char buffer[RC_LINEBUFFER]; + char *buffer = NULL; int len; int i; int j; @@ -685,6 +685,7 @@ bool rc_deptree_update (void) deptree = xmalloc (sizeof (rc_depinfo_t)); memset (deptree, 0, sizeof (rc_depinfo_t)); + buffer = xmalloc (sizeof (char) * RC_LINEBUFFER); memset (buffer, 0, RC_LINEBUFFER); /* Phase 2 */ @@ -776,6 +777,7 @@ bool rc_deptree_update (void) } pclose (fp); + free (buffer); /* Phase 3 - add our providors to the tree */ for (depinfo = deptree; depinfo; depinfo = depinfo->next) -- cgit v1.2.3