From: Cyril Hrubis <chrubis@suse.cz>
To: Manjeet Pawar <manjeet.p@samsung.com>
Cc: AJEET YADAV <ajeet.y@samsung.com>,
"ltp-list@lists.sourceforge.net" <ltp-list@lists.sourceforge.net>,
Yogesh Narayan Gaur <yn.gaur@samsung.com>
Subject: Re: [LTP] [PATCH]: Add check for realloc failure case
Date: Thu, 4 Jun 2015 18:27:57 +0200 [thread overview]
Message-ID: <20150604162757.GA8495@rei.suse.de> (raw)
In-Reply-To: <149090115.398111433218346536.JavaMail.weblogic@epmlwas08b>
Hi!
> @@ -113,6 +114,12 @@ const char **splitstr(const char *str, const char *separator, int *argcount)
> arg_array =
> (char **)realloc((void *)arg_array,
> sizeof(char *) * max_toks);
> + if (arg_array == NULL) {
> + fprintf(stderr, "realloc: New memory allocation failed \n");
> + free(arg_array);
I've removed the free(arg_array) here, because it's noop (doing free(NULL)) and pushed both patches.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next parent reply other threads:[~2015-06-04 16:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <149090115.398111433218346536.JavaMail.weblogic@epmlwas08b>
2015-06-04 16:27 ` Cyril Hrubis [this message]
2015-05-28 4:36 [LTP] [PATCH]: Add check for realloc() failure case Manjeet Pawar
-- strict thread matches above, loose matches on Subject: below --
2015-05-28 4:33 Manjeet Pawar
2015-06-01 14:25 ` Cyril Hrubis
2015-05-28 4:30 [LTP] [PATCH]: Add check for realloc " Manjeet Pawar
2015-06-01 14:22 ` Cyril Hrubis
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=20150604162757.GA8495@rei.suse.de \
--to=chrubis@suse.cz \
--cc=ajeet.y@samsung.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=manjeet.p@samsung.com \
--cc=yn.gaur@samsung.com \
/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