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

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