From f05276c4bf63c327da914ed4aae2568f38e47892 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 29 Jan 2007 23:47:37 +0100 Subject: [PATCH] mysql_selector.c: free(NULL) is OK. No need to check for NULL. Moreover, stream, meta, atts and dir are set in any case so kill the NULL initialization. --- mysql_selector.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mysql_selector.c b/mysql_selector.c index e2812fd7..91972e84 100644 --- a/mysql_selector.c +++ b/mysql_selector.c @@ -766,7 +766,7 @@ out: */ static char *get_selector_info(char *name) { - char *meta = NULL, *atts = NULL, *info, *dir = NULL, *query, *stream = NULL; + char *meta, *atts, *info, *dir, *query, *stream; void *result = NULL; MYSQL_ROW row = NULL; @@ -792,14 +792,10 @@ write: stream, meta, (result && row && row[0])? row[0] : "(no score)", atts); - if (dir) - free(dir); - if (meta) - free(meta); - if (atts) - free(atts); - if (stream) - free(stream); + free(dir); + free(meta); + free(atts); + free(stream); if (result) mysql_free_result(result); return info; -- 2.39.5