summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael McConville <mmcconville@mykolab.com>2015-12-09 13:03:57 -0500
committerWill Estes <westes575@gmail.com>2015-12-09 13:15:08 -0500
commit79691346871720fe2f5885412714a3dce17418f7 (patch)
treefc003cb0289dde3c9363159b6ccc1d5d55618ae8 /src
parentd95947343e8a52957048b1d0b72c262183f2723f (diff)
Removed NULL-checks before free()
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
-rw-r--r--src/scanopt.c7
-rw-r--r--src/tables.c3
3 files changed, 5 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 4caf8d6..5fadfc4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -398,8 +398,7 @@ void check_options (void)
if ((tablesout = fopen (tablesfilename, "w")) == NULL)
lerr (_("could not create %s"), tablesfilename);
- if (pname)
- free (pname);
+ free(pname);
tablesfilename = 0;
yytbl_writer_init (&tableswr, tablesout);
diff --git a/src/scanopt.c b/src/scanopt.c
index b59bb13..22e35b3 100644
--- a/src/scanopt.c
+++ b/src/scanopt.c
@@ -818,10 +818,9 @@ int scanopt_destroy (scanopt_t *svoid)
struct _scanopt_t *s;
s = (struct _scanopt_t *) svoid;
- if (s) {
- if (s->aux)
- free (s->aux);
- free (s);
+ if (s != NULL) {
+ free(s->aux);
+ free(s);
}
return 0;
}
diff --git a/src/tables.c b/src/tables.c
index 62a9dcc..ae2ad9c 100644
--- a/src/tables.c
+++ b/src/tables.c
@@ -115,8 +115,7 @@ int yytbl_data_init (struct yytbl_data *td, enum yytbl_id id)
*/
int yytbl_data_destroy (struct yytbl_data *td)
{
- if (td->td_data)
- free (td->td_data);
+ free(td->td_data);
td->td_data = 0;
free (td);
return 0;