texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Fix memory leaks.


From: Gavin D. Smith
Subject: branch master updated: Fix memory leaks.
Date: Sun, 25 Apr 2021 10:45:37 -0400

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 29cb6b4  Fix memory leaks.
29cb6b4 is described below

commit 29cb6b435a07a587d99403d2cd05b32db8babfec
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Apr 25 15:45:31 2021 +0100

    Fix memory leaks.
    
    * info/nodes.c (get_nodes_of_tags_table):
    info_create_tag returns a pointer to a newly allocated TAG structure.
    Before continuing to the start of the loop it is necessary to free the
    current TAG structure, because the pointer will be overwritten by
    new value in the next iteration of the loop.
---
 ChangeLog      | 10 ++++++++++
 info/nodes.c   |  5 ++++-
 info/session.c |  2 +-
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 307f43e..1220b05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,16 @@
 2021-04-25  Vitezslav Crhonek <vcrhonek@redhat.com>  (tiny change)
 
        Fix memory leaks.
+
+       * info/nodes.c (get_nodes_of_tags_table):
+       info_create_tag returns a pointer to a newly allocated TAG structure.
+       Before continuing to the start of the loop it is necessary to free the
+       current TAG structure, because the pointer will be overwritten by
+       new value in the next iteration of the loop.
+
+2021-04-25  Vitezslav Crhonek <vcrhonek@redhat.com>  (tiny change)
+
+       Fix memory leaks.
        
        * info/makedoc.c (process_one_file):
        The memory is freed for both pointers at the end of the loop.
diff --git a/info/nodes.c b/info/nodes.c
index 4722825..631e7af 100644
--- a/info/nodes.c
+++ b/info/nodes.c
@@ -303,7 +303,10 @@ get_nodes_of_tags_table (FILE_BUFFER *file_buffer,
       for (p = 0; nodedef[p] && nodedef[p] != INFO_TAGSEP; p++)
         ;
       if (nodedef[p] != INFO_TAGSEP)
-        continue;
+        {
+          free (entry);
+          continue;
+        }
 
       entry->nodename = xmalloc (p + 1);
       strncpy (entry->nodename, nodedef, p);
diff --git a/info/session.c b/info/session.c
index d67641b..8222f9c 100644
--- a/info/session.c
+++ b/info/session.c
@@ -1,6 +1,6 @@
 /* session.c -- user windowing interface to Info.
 
-   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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]