From: Andre Noll Date: Mon, 29 Jan 2007 22:47:37 +0000 (+0100) Subject: mysql_selector.c: free(NULL) is OK. X-Git-Tag: v0.2.15~54 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f05276c4bf63c327da914ed4aae2568f38e47892 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. --- 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;