aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author"John Hawthorn ext:(%22) <jhawthor@uvic.ca>2008-12-31 18:00:06 -0800
committer"John Hawthorn ext:(%22) <jhawthor@uvic.ca>2008-12-31 18:00:06 -0800
commitc6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c (patch)
treebfefe1e078b7e7bc106a6caae726d5df1d663002
parentbf9f8695786a65e5dcf9d2dc02bc60369063b80a (diff)
downloadmirror-meh-c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c.tar.gz
mirror-meh-c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c.tar.bz2
mirror-meh-c6ef9db927d48062fcfd1ba43ad9fd4bbbb5a63c.zip
minor bug
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 57d8723..903ec1a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -284,9 +284,12 @@ void readlist(FILE *f){
char *line = NULL;
size_t slen = 0;
ssize_t read;
- if((read = getline(&line, &slen, f)) > 0){
+ read = getline(&line, &slen, f);
+ if(read > 1){
line[read-1] = '\0';
images[imageslen++] = line;
+ }else if(line){
+ free(line);
}
}
lsize *= 2;