GNS3 / GNS3/dynamips

Potential memory-leak

Open
#291 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
405
Forks
99
Avg merge
3m
Merged PRs (30d)
1

Description

Hi, I have found a potential memory-leak bug in the project and would like to report it to the maintainers. Can you please help me to check it? Thank you for your effort and patience!

In function rommon_var_set in file common/rommon_var.c, new_value is assigned with newly allocated memory at line 110 and then stored into var->value at line 117, where var is the first param of the function. But in function rommon_var_add (also in file common/rommon_var.c) , var is local and used as the 1st param of the call for rommon_var_set at line 139, where var->value is not freed and a memory-leak bug may occur.

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in common/rommon_var.c with rommon_var_add and rommon_var_set, then trace ownership of var->value through the allocation at the referenced lines. Confirm whether the local var retains allocated memory without cleanup, and verify that the corrected ownership path no longer leaks.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.