[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Gavin D. Smith |
Date: |
Sun, 25 Apr 2021 10:31:41 -0400 (EDT) |
branch: master
commit 0d1b85c80f9126d9761678ba6817a878fa5fbb66
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Apr 25 15:26:33 2021 +0100
Fix memory leaks.
* info/m-x.c (describe_command): Always free a variable.
* info/filesys.c (info_file_find_next_in_path): Do not free a string
that shouldn't be freed.
Reports from Vitezslav Crhonek.
---
ChangeLog | 10 ++++++++++
info/filesys.c | 3 +--
info/m-x.c | 14 ++++++--------
3 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a54a2da..0251850 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-04-25 Gavin Smith <gavinsmith0123@gmail.com>
+
+ Fix memory leaks.
+
+ * info/m-x.c (describe_command): Always free a variable.
+ * info/filesys.c (info_file_find_next_in_path): Do not free a string
+ that shouldn't be freed.
+
+ Reports from Vitezslav Crhonek.
+
2021-04-14 Gavin Smith <gavinsmith0123@gmail.com>
* doc/texinfo.tex (\doxeteximage):
diff --git a/info/filesys.c b/info/filesys.c
index c49088d..3def765 100644
--- a/info/filesys.c
+++ b/info/filesys.c
@@ -1,6 +1,6 @@
/* filesys.c -- filesystem specific functions.
- Copyright 1993-2020 Free Software Foundation, Inc.
+ Copyright 1993-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -153,7 +153,6 @@ info_file_find_next_in_path (char *filename, int
*path_index, struct stat *finfo
if (*dirname == '~')
{
char *expanded_dirname = tilde_expand_word (dirname);
- free (dirname);
dirname = expanded_dirname;
}
diff --git a/info/m-x.c b/info/m-x.c
index 64984bb..2515eee 100644
--- a/info/m-x.c
+++ b/info/m-x.c
@@ -1,6 +1,6 @@
/* m-x.c -- Meta-x minibuffer reader.
- Copyright 1993-2019 Free Software Foundation, Inc.
+ Copyright 1993-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -73,16 +73,14 @@ DECLARE_INFO_COMMAND (describe_command,
return;
}
- /* Describe the function named in "LINE". */
if (*line)
{
InfoCommand *cmd = named_function (line);
-
- if (!cmd)
- return;
-
- window_message_in_echo_area ("%s: %s.",
- line, function_documentation (cmd));
+ if (cmd)
+ {
+ window_message_in_echo_area ("%s: %s.",
+ line, function_documentation (cmd));
+ }
}
free (line);
}