From: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [opensm] [PATCH 1/2] Fix segfault corner case
Date: Fri, 11 Nov 2011 14:19:57 +0200 [thread overview]
Message-ID: <20111111121957.GA2968@calypso.mtl.com> (raw)
In-Reply-To: <1320948093.22519.337.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
Hi Al,
On 10:01 Thu 10 Nov , Albert Chu wrote:
> On rescan, data segment memory could be attempted to be freed by
> config file parsing code.
>
> Signed-off-by: Albert L. Chu <chu11-i2BcT+NCU+M@public.gmane.org>
> ---
> opensm/osm_subnet.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
> index 554a950..c8a8add 100644
> --- a/opensm/osm_subnet.c
> +++ b/opensm/osm_subnet.c
> @@ -1159,7 +1159,7 @@ int osm_subn_verify_config(IN osm_subn_opt_t * p_opts)
> log_report(" Invalid Cached Option Value:console = %s"
> ", Using Default:%s\n",
> p_opts->console, OSM_DEFAULT_CONSOLE);
> - p_opts->console = OSM_DEFAULT_CONSOLE;
> + p_opts->console = strdup(OSM_DEFAULT_CONSOLE);
If console is set to a wrong value, you get some memory leak here, because
strdup() allocates new buffer and the old one is never free.
> }
>
> if (p_opts->qos) {
> --
> 1.7.1
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
-- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-11-11 12:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 18:01 [opensm] [PATCH 1/2] Fix segfault corner case Albert Chu
[not found] ` <1320948093.22519.337.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
2011-11-11 12:19 ` Alex Netes [this message]
[not found] ` <20111111121957.GA2968-iQai9MGU/dze+A/uUDamNg@public.gmane.org>
2011-11-11 17:58 ` Albert Chu
[not found] ` <1321034297.22519.376.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
2011-11-11 18:04 ` [opensm] [PATCH 1/2] Fix memleak and segfault Albert Chu
[not found] ` <1321034692.22519.382.camel-akkeaxHeDKRliZ7u+bvwcg@public.gmane.org>
2012-01-10 16:26 ` Alex Netes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111111121957.GA2968@calypso.mtl.com \
--to=alexne-vpraknaxozvwk0htik3j/w@public.gmane.org \
--cc=chu11-i2BcT+NCU+M@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox