summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Greenan <kmgreen2@gmail.com>2014-10-03 08:55:35 -0700
committerKevin Greenan <kmgreen2@gmail.com>2014-10-03 08:55:35 -0700
commit62d4b81a833477e596c3ec264f83c08901eeea5b (patch)
tree6ca48087dea265337205f80cb113675eb517c5ff
parent87d7e8fbb08205cb739235cfb5524c85e1d884c2 (diff)
parentdfffff27407a78a37ee5b4329bf4d5298e509890 (diff)
downloadgf-complete-62d4b81a833477e596c3ec264f83c08901eeea5b.tar.gz
Merged in dachary/gf-complete/wip-static-code-analysis (pull request #24)
static code analysis fixes
-rw-r--r--src/gf.c2
-rw-r--r--src/gf_method.c1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/gf.c b/src/gf.c
index 2c232ec..10c9b3c 100644
--- a/src/gf.c
+++ b/src/gf.c
@@ -392,7 +392,7 @@ int gf_error_check(int w, int mult_type, int region_type, int divide_type,
if (mult_type == GF_MULT_COMPOSITE) {
if (w != 8 && w != 16 && w != 32
&& w != 64 && w != 128) { _gf_errno = GF_E_COMP__W; return 0; }
- if ((poly >> (w/2)) != 0) { _gf_errno = GF_E_COMP_PP; return 0; }
+ if (w < 128 && (poly >> (w/2)) != 0) { _gf_errno = GF_E_COMP_PP; return 0; }
if (divide_type != GF_DIVIDE_DEFAULT) { _gf_errno = GF_E_DIVCOMP; return 0; }
if (arg1 != 2) { _gf_errno = GF_E_COMP_A2; return 0; }
if (rsse || rnosse) { _gf_errno = GF_E_COMP_SS; return 0; }
diff --git a/src/gf_method.c b/src/gf_method.c
index 6fb869e..2548a63 100644
--- a/src/gf_method.c
+++ b/src/gf_method.c
@@ -107,7 +107,6 @@ int create_gf_from_argv(gf_t *gf, int w, int argc, char **argv, int starting)
return 0;
}
} else {
- if (base != NULL) gf_free(base, 1);
_gf_errno = GF_E_UNKNOWN;
return 0;
}