Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 865977 Details for
Bug 1067085
`man -M /path man` crashes
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
man-db-2.6.3-valgrind.patch
man-db-2.6.3-valgrind.patch (text/plain), 8.06 KB, created by
Peter Schiffer
on 2014-02-21 12:35:21 UTC
(
hide
)
Description:
man-db-2.6.3-valgrind.patch
Filename:
MIME Type:
Creator:
Peter Schiffer
Created:
2014-02-21 12:35:21 UTC
Size:
8.06 KB
patch
obsolete
>diff -upr man-db-2.6.3.orig/lib/encodings.c man-db-2.6.3/lib/encodings.c >--- man-db-2.6.3.orig/lib/encodings.c 2013-09-24 18:10:58.730634000 +0200 >+++ man-db-2.6.3/lib/encodings.c 2013-09-24 18:11:49.095281568 +0200 >@@ -559,6 +559,7 @@ const char *get_locale_charset (void) > > /* Restore LC_CTYPE to its value on entry to this function. */ > setlocale (LC_CTYPE, saved_locale); >+ free (saved_locale); > > if (charset && *charset) > return get_canonical_charset_name (charset); >diff -upr man-db-2.6.3.orig/src/check_mandirs.c man-db-2.6.3/src/check_mandirs.c >--- man-db-2.6.3.orig/src/check_mandirs.c 2013-09-24 18:10:58.735634000 +0200 >+++ man-db-2.6.3/src/check_mandirs.c 2013-09-24 18:11:49.096281561 +0200 >@@ -442,6 +442,7 @@ static int testmandirs (const char *path > > if (chdir (path) != 0) { > error (0, errno, _("can't change to directory %s"), path); >+ closedir (dir); > return 0; > } > >@@ -479,11 +480,13 @@ static int testmandirs (const char *path > if (errno == EACCES || errno == EROFS) { > debug ("database %s is read-only\n", > database); >+ closedir (dir); > return 0; > } else { > error (0, errno, > _("can't create index cache %s"), > database); >+ closedir (dir); > return -errno; > } > } >@@ -496,6 +499,7 @@ static int testmandirs (const char *path > > if (!dbf) { > gripe_rwopen_failed (); >+ closedir (dir); > return 0; > } > >diff -upr man-db-2.6.3.orig/src/man.c man-db-2.6.3/src/man.c >--- man-db-2.6.3.orig/src/man.c 2013-09-24 18:10:58.732634000 +0200 >+++ man-db-2.6.3/src/man.c 2013-09-24 18:11:49.096281561 +0200 >@@ -188,7 +188,7 @@ static char *manpathlist[MAXDIRS]; > /* globals */ > int quiet = 1; > char *program_name; >-char *database; >+char *database = NULL; > MYDBM_FILE dbf; > extern const char *extension; /* for globbing.c */ > extern char *user_config_file; /* defined in manp.c */ >@@ -950,7 +950,7 @@ static int local_man_loop (const char *a > > if (directory_on_path (argv_dir)) { > char *argv_base = base_name (argv); >- char *new_manp; >+ char *new_manp, *nm; > char **old_manpathlist, **mp; > > debug ("recalculating manpath for executable " >@@ -962,7 +962,9 @@ static int local_man_loop (const char *a > "executable\n"); > goto executable_out; > } >- new_manp = locale_manpath (new_manp); >+ nm = locale_manpath (new_manp); >+ free (new_manp); >+ new_manp = nm; > > old_manpathlist = XNMALLOC (MAXDIRS, char *); > memcpy (old_manpathlist, manpathlist, >@@ -1167,15 +1169,21 @@ int main (int argc, char *argv[]) > manp = get_manpath (""); > printf ("%s\n", manp); > exit (OK); >- } else >+ } else { >+ free (cwd); >+ free (internal_locale); >+ free (program_name); > gripe_no_name (NULL); >+ } > } > > section_list = get_section_list (); > >- if (manp == NULL) >- manp = locale_manpath (get_manpath (alt_system_name)); >- else >+ if (manp == NULL) { >+ char *mp = get_manpath (alt_system_name); >+ manp = locale_manpath (mp); >+ free (mp); >+ } else > free (get_manpath (NULL)); > > debug ("manpath search path (with duplicates) = %s\n", manp); >@@ -1350,6 +1358,7 @@ int main (int argc, char *argv[]) > if (cwd[0]) > chdir (cwd); > >+ free (database); > free_pathlist (manpathlist); > free (cwd); > free (internal_locale); >@@ -2327,6 +2336,7 @@ static void format_display (pipeline *de > htmldir); > free (htmlfile); > free (htmldir); >+ free (old_cwd); > } else > #endif /* TROFF_IS_GROFF */ > /* TODO: check format_cmd status too? */ >@@ -2498,6 +2508,7 @@ static int display (const char *dir, con > free (name); > free_locale_bits (&bits); > } >+ free (page_lang); > } > #endif /* TROFF_IS_GROFF */ > >@@ -2564,6 +2575,7 @@ static int display (const char *dir, con > if (prompt && do_prompt (title)) { > pipeline_free (format_cmd); > pipeline_free (decomp); >+ free (formatted_encoding); > return 0; > } > drop_effective_privs (); >@@ -2690,6 +2702,7 @@ static int display (const char *dir, con > if (prompt && do_prompt (title)) { > pipeline_free (format_cmd); > pipeline_free (decomp); >+ free (formatted_encoding); > if (local_man_file) > return 1; > else >@@ -2741,6 +2754,8 @@ static int display (const char *dir, con > } > } > >+ free (formatted_encoding); >+ > pipeline_free (format_cmd); > pipeline_free (decomp); > >@@ -2802,6 +2817,7 @@ static char *find_cat_file (const char * > *tmp = 0; > if (is_directory (cat_dir)) { > debug ("will try cat file %s\n", cat_file); >+ free (cat_dir); > return cat_file; > } else > debug ("cat dir %s does not exist\n", cat_dir); >@@ -3276,6 +3292,8 @@ static int try_section (const char *path > struct mandata *info = infoalloc (); > char *info_buffer = filename_info (*np, info, name); > const char *ult; >+ int f; >+ > if (!info_buffer) { > free_mandata_struct (info); > continue; >@@ -3300,8 +3318,17 @@ static int try_section (const char *path > else > info->id = SO_MAN; > >- found += add_candidate (cand_head, CANDIDATE_FILESYSTEM, >- cat, name, path, ult, info); >+ f = add_candidate (cand_head, CANDIDATE_FILESYSTEM, >+ cat, name, path, ult, info); >+ found += f; >+ /* Free info and info_buffer if they weren't added to the >+ * candidates. >+ */ >+ if (f == 0) { >+ free (info_buffer); >+ info->addr = NULL; >+ free_mandata_struct (info); >+ } > /* Don't free info and info_buffer here. */ > } > >@@ -3319,9 +3346,15 @@ static int display_filesystem (struct ca > char *title = appendstr (NULL, candp->source->name, > "(", candp->source->ext, ")", NULL); > if (candp->cat) { >- if (troff || want_encoding || recode) >+ int r; >+ >+ if (troff || want_encoding || recode) { >+ free (title); > return 0; >- return display (candp->path, NULL, filename, title, NULL); >+ } >+ r = display (candp->path, NULL, filename, title, NULL); >+ free (title); >+ return r; > } else { > const char *man_file; > char *cat_file; >@@ -3344,6 +3377,7 @@ static int display_filesystem (struct ca > free (lang); > lang = NULL; > free (title); >+ free (filename); > > return found; > } >@@ -3571,6 +3605,7 @@ static int try_db (const char *manpath, > /* find out where our db for this manpath should be */ > > catpath = get_catpath (manpath, global_manpath ? SYSTEM_CAT : USER_CAT); >+ free (database); > if (catpath) { > database = mkdbname (catpath); > free (catpath); >@@ -3942,7 +3977,7 @@ static int man (const char *name, int *f > > for (cand = candidates; cand; cand = candnext) { > candnext = cand->next; >- free (cand); >+ free_candidate (cand); > } > > return *found ? OK : NOT_FOUND; >diff -upr man-db-2.6.3.orig/src/manp.c man-db-2.6.3/src/manp.c >--- man-db-2.6.3.orig/src/manp.c 2013-09-24 18:10:58.733634000 +0200 >+++ man-db-2.6.3/src/manp.c 2013-09-24 18:11:49.097281554 +0200 >@@ -504,6 +504,7 @@ static char *get_nls_manpath (const char > > closedir (mandir); > } >+ free (manpathlist_copy); > > free_locale_bits (&lbits); > return manpath; >@@ -567,6 +568,7 @@ char *add_nls_manpaths (char *manpathlis > free (locale_manpath); > } > } >+ free (locales_copy); > > /* Always try untranslated pages as a last resort. */ > locale_manpath = get_nls_manpath (manpathlist, "C"); >@@ -820,6 +822,8 @@ next: > free (buf); > buf = NULL; > } >+ >+ free (buf); > } > > static void free_config_file (void *unused ATTRIBUTE_UNUSED) >diff -upr man-db-2.6.3.orig/src/whatis.c man-db-2.6.3/src/whatis.c >--- man-db-2.6.3.orig/src/whatis.c 2012-06-18 12:23:37.000000000 +0200 >+++ man-db-2.6.3/src/whatis.c 2013-09-24 18:11:49.097281554 +0200 >@@ -501,7 +501,7 @@ static inline int do_whatis_section (con > > static int suitable_manpath (const char *manpath, const char *page_dir) > { >- char *page_manp; >+ char *page_manp, *pm; > char *page_manpathlist[MAXDIRS], **mp; > int ret; > >@@ -510,7 +510,9 @@ static int suitable_manpath (const char > free (page_manp); > return 0; > } >- page_manp = locale_manpath (page_manp); >+ pm = locale_manpath (page_manp); >+ free (page_manp); >+ page_manp = pm; > create_pathlist (page_manp, page_manpathlist); > > ret = 0; >@@ -554,6 +556,7 @@ static void do_whatis (const char * cons > debug ("%s not on manpath for %s\n", > manpath, page); > free (page_dir); >+ free (page); > continue; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1067085
: 865977