[From nobody Wed Oct 9 12:00:19 2013 From: "=?utf-8?b?VG9tw6HFoSBCxb5hdGVr?=" <reviewboard@gallagherhome.com> Precedence: list MIME-Version: 1.0 To: =?utf-8?b?VG9tw6HFoSBCxb5hdGVr?= <tbzatek@redhat.com>, Michal Minar <miminar@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 10:26:33 -0000 Reply-To: =?utf-8?b?VG9tw6HFoSBCxb5hdGVr?= <tbzatek@redhat.com>, openlmi-reviews@lists.fedorahosted.org Message-ID: <20131009102633.20614.30558@ex-std-node147.prod.rhcloud.com> Content-Type: multipart/alternative; boundary="===============1632856813605518258==" Subject: Re: Review Request 967: parse_config: Don't reuse already initialized GError struct Message: 43 --===============1632856813605518258== 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/ ----------------------------------------------------------- (Updated Oct. 9, 2013, 10:26 a.m.) Status ------ This change has been marked as submitted. 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 --===============1632856813605518258== 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 /> <table bgcolor="#e0e0e0" width="100%" cellpadding="8" style="border: 1px gray solid;"> <tr> <td> <h1 style="margin-right: 0.2em; padding: 0; font-size: 10pt;">This change has been marked as submitted.</h1> </td> </tr> </table> <br /> <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. 9, 2013, 10:26 a.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> --===============1632856813605518258==-- ]