Blame SOURCES/man-db-2.9.3-coverity.patch

a4b5d2
diff --git a/src/man.c b/src/man.c
a4b5d2
index b3d13d1..030a5d1 100644
a4b5d2
--- a/src/man.c
a4b5d2
+++ b/src/man.c
a4b5d2
@@ -991,11 +991,17 @@ static char *get_preprocessors_from_file (pipeline *decomp, int prefixes)
a4b5d2
 
a4b5d2
 	if (!strncmp (line, PP_COOKIE, 4)) {
a4b5d2
 		const char *newline = strchr (line, '\n');
a4b5d2
-		if (newline)
a4b5d2
-			return xstrndup (line + 4, newline - (line + 4));
a4b5d2
-		else
a4b5d2
-			return xstrdup (line + 4);
a4b5d2
+		if (newline) {
a4b5d2
+			char *ret = xstrndup (line + 4, newline - (line + 4));
a4b5d2
+			free (line);
a4b5d2
+			return ret;
a4b5d2
+		} else {
a4b5d2
+			char *ret = xstrdup (line + 4);
a4b5d2
+			free (line);
a4b5d2
+			return ret;
a4b5d2
+		}
a4b5d2
 	}
a4b5d2
+	free (line);
a4b5d2
 	return NULL;
a4b5d2
 }
a4b5d2
 
a4b5d2
@@ -2401,6 +2407,7 @@ static int display (const char *dir, const char *man_file,
a4b5d2
 		if (!found) {
a4b5d2
 			pipeline_free (format_cmd);
a4b5d2
 			pipeline_free (decomp);
a4b5d2
+			free (formatted_encoding);
a4b5d2
 			return found;
a4b5d2
 		}
a4b5d2
 
a4b5d2
diff --git a/src/zsoelim.c b/src/zsoelim.c
a4b5d2
index bf5c8ff..6a484c4 100644
a4b5d2
--- a/src/zsoelim.c
a4b5d2
+++ b/src/zsoelim.c
a4b5d2
@@ -2528,6 +2528,7 @@ int zsoelim_open_file (const char *filename, gl_list_t manpathlist,
a4b5d2
 					if (decomp) {
a4b5d2
 						NAME = xstrdup (found_name);
a4b5d2
 						gl_list_free (names);
a4b5d2
+						free (name);
a4b5d2
 						goto out;
a4b5d2
 					}
a4b5d2
 				} GL_LIST_FOREACH_END (names);
a4b5d2
diff --git a/src/zsoelim.l b/src/zsoelim.l
a4b5d2
index a8a7e3b..3cb552b 100644
a4b5d2
--- a/src/zsoelim.l
a4b5d2
+++ b/src/zsoelim.l
a4b5d2
@@ -473,6 +473,7 @@ int zsoelim_open_file (const char *filename, gl_list_t manpathlist,
a4b5d2
 					if (decomp) {
a4b5d2
 						NAME = xstrdup (found_name);
a4b5d2
 						gl_list_free (names);
a4b5d2
+						free (name);
a4b5d2
 						goto out;
a4b5d2
 					}
a4b5d2
 				} GL_LIST_FOREACH_END (names);