[From nobody Wed Oct 9 12:00:19 2013 From: Michal Minar <reviewboard@gallagherhome.com> Precedence: list MIME-Version: 1.0 To: Michal Minar <miminar@redhat.com>, =?utf-8?b?VG9tw6HFoSBCxb5hdGVr?= <tbzatek@redhat.com>, OpenLMI Developers <openlmi-reviews@lists.fedorahosted.org> References: <20131008155855.20614.20465@ex-std-node147.prod.rhcloud.com> In-Reply-To: <20131008155855.20614.20465@ex-std-node147.prod.rhcloud.com> Date: Wed, 09 Oct 2013 05:17:23 -0000 Reply-To: Michal Minar <miminar@redhat.com>, openlmi-reviews@lists.fedorahosted.org Message-ID: <20131009051723.20614.43192@ex-std-node147.prod.rhcloud.com> Content-Type: multipart/alternative; boundary="===============0078237165441253705==" Subject: Re: Review Request 967: parse_config: Don't reuse already initialized GError struct Message: 18 --===============0078237165441253705== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/967/#review1366 ----------------------------------------------------------- Ship it! Ship It! - Michal Minar On Oct. 8, 2013, 3:58 p.m., Tomáš Bžatek wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviewboard-openlmi.rhcloud.com/r/967/ > ----------------------------------------------------------- > > (Updated Oct. 8, 2013, 3:58 p.m.) > > > Review request for OpenLMI Developers. > > > Repository: openlmi-providers > > > Description > ------- > > parse_config: Don't reuse already initialized GError struct > > Setting an error on top of an existing error is considered a programmer's > bug, possibly leaking memory. So do proper cleanup before reusing that > variable. > > Also, errors set while retrieving keys and values are not checked anywhere > so let's just don't set them. Returned NULL values in case of error should > be enough to skip the particular value. > > -- > This happens when not having the openlmi.conf file installed, failing in two file reads in a row. > > > Diffs > ----- > > src/openlmi.c 25cf57c86b4e05983f376dff69d6d52a25182daa > > Diff: http://reviewboard-openlmi.rhcloud.com/r/967/diff/ > > > Testing > ------- > > > Thanks, > > Tomáš Bžatek > > --===============0078237165441253705== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit <html> <body> <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;"> <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;"> <tr> <td> This is an automatically generated e-mail. To reply, visit: <a href="http://reviewboard-openlmi.rhcloud.com/r/967/">http://reviewboard-openlmi.rhcloud.com/r/967/</a> </td> </tr> </table> <br /> <p>Ship it!</p> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ship It!</pre> <br /> <p>- Michal Minar</p> <br /> <p>On October 8th, 2013, 3:58 p.m. UTC, Tomáš Bžatek wrote:</p> <table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://reviewboard-openlmi.rhcloud.com/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;"> <tr> <td> <div>Review request for OpenLMI Developers.</div> <div>By Tomáš Bžatek.</div> <p style="color: grey;"><i>Updated Oct. 8, 2013, 3:58 p.m.</i></p> <div style="margin-top: 1.5em;"> <b style="color: #575012; font-size: 10pt;">Repository: </b> openlmi-providers </div> <h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1> <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0"> <tr> <td> <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">parse_config: Don&#39;t reuse already initialized GError struct Setting an error on top of an existing error is considered a programmer&#39;s bug, possibly leaking memory. So do proper cleanup before reusing that variable. Also, errors set while retrieving keys and values are not checked anywhere so let&#39;s just don&#39;t set them. Returned NULL values in case of error should be enough to skip the particular value. -- This happens when not having the openlmi.conf file installed, failing in two file reads in a row.</pre> </td> </tr> </table> <h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1> <ul style="margin-left: 3em; padding-left: 0;"> <li>src/openlmi.c <span style="color: grey">(25cf57c86b4e05983f376dff69d6d52a25182daa)</span></li> </ul> <p><a href="http://reviewboard-openlmi.rhcloud.com/r/967/diff/" style="margin-left: 3em;">View Diff</a></p> </td> </tr> </table> </div> </body> </html> --===============0078237165441253705==-- ]