From c3cc10a2658dd76d6bb3762ee7b3ca137c16200e Mon Sep 17 00:00:00 2001 From: "v.audacity" Date: Mon, 13 Sep 2010 23:42:21 +0000 Subject: [PATCH] Fix a couple of errors reported by Wipro. --- lib-src/libnyquist/nyquist/cmt/cmdline.c | 3 ++- lib-src/libnyquist/nyquist/cmt/seq.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib-src/libnyquist/nyquist/cmt/cmdline.c b/lib-src/libnyquist/nyquist/cmt/cmdline.c index 4440f3555..0882bd6aa 100644 --- a/lib-src/libnyquist/nyquist/cmt/cmdline.c +++ b/lib-src/libnyquist/nyquist/cmt/cmdline.c @@ -446,7 +446,7 @@ private void indirect_command(filename, oldarg0) argv[0] = oldarg0; argc = 1; } else { - int i = 1; + int i = 1; char arg[100]; while (get_arg(argfile, arg)) i++; fclose(argfile); @@ -460,6 +460,7 @@ private void indirect_command(filename, oldarg0) strcpy(argv[i], arg); i++; } + fclose(argfile); } } diff --git a/lib-src/libnyquist/nyquist/cmt/seq.c b/lib-src/libnyquist/nyquist/cmt/seq.c index eb7fc0442..07cf567ba 100644 --- a/lib-src/libnyquist/nyquist/cmt/seq.c +++ b/lib-src/libnyquist/nyquist/cmt/seq.c @@ -58,7 +58,8 @@ private char *chunk_alloc(seq_type seq, int size) if (size & 1) size++; /* make it even */ if (chunk->free + size >= CHUNK_SIZE) { chunk_type new_chunk = chunk_create(FALSE); - if (!chunk) { + if (!new_chunk) + { gprintf(FATAL, "Out of memory while reading seq\n"); return NULL; }