<div dir="ltr"><div><div><div>Good night again, Dirk and Miika.  Good night Guido.<br><br>2015-09-09 17:29 GMT+02:00 Miika Turkia <span dir="ltr"><<a href="mailto:miika.turkia@gmail.com" target="_blank">miika.turkia@gmail.com</a>></span>:<br>> I am looking at ostc_prepare_data function and do not fully understand<br>
> the code. It looks like in successful case ldc_dat memory allocation<br>
> is freed and we end up pointing to unallocated data in our data<br>> structures. However, the failure case ends up leaking memory.<br>
><br>
> Is the attached patch correct or am I missing something? (I have<br>> nothing to test the code with.)<br>
</div><div><span class=""><font color="#888888"><br></font></span></div><div>The patch works, although it changes leak on failure with leak on success.<br></div><div>In fact the full ldc_dat pointer is useless and can be safely removed, it was a remnant of initial work.  This was the reason you didn't understand the code.<br></div><div>If you want to test, there are two .dive files included in dives directory.<br></div><div><br></div><div>Please, Dirk, apply the attached patch instead of Miika's one.<br></div><div><div class="gmail_extra"><div class="gmail_quote"><br>2015-09-09 18:54 GMT+02:00 Dirk Hohndel <span dir="ltr"><<a href="mailto:dirk@hohndel.org" target="_blank">dirk@hohndel.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Wed, Sep 09, 2015 at 07:48:03PM +0300, Guido Lerch wrote:<br>
><br>
> Hi Miika<br>
> I might have some time to test tomorrow. I have an OSTC 3.<br>
> Need to figure out first how to apply the patch my testing branch, Google will help I suppose.<br>
<br></span></blockquote><div><br></div><div>Guido, please note that this  has nothing to do with OSTC devices downloads, it is a tool intended to import dives which have been previously downloaded from DC using OSTCTools software.  If you want to try the import, you have to have the .dive files made with said program. <br></div><div>BTW, if you have OSTCTools files of your own, you may find that some dives from OSTC3 fail in the middle of the profile.  It is due to a problem in some OSTC 3 firmware versions that H&W corrected some time ago.  OSTCTools reads the full profile data, but libdivecomputer aborts as it does sanity checks and detects inconsistent data  (e.g.  216% O2 in the mix).  The profile needs, in these cases, to be manually fixed changing the damaged bytes in the .dive file.<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">
</span>It's pretty easy. Save the email to a file.<br>
<br>
git am < file<br>
<br>
am literally stands for "apply mail" :-)<br>
<span class=""><font color="#888888"><br>
</font></span></blockquote><div><br></div><div>Although Dirk knows light years more about git than I will ever do,  I have to say that git am /path/to/file.patch  without "<"  works exactly the same  ;-)<br><br></div><div>Regards.<br><br></div><div>Salva.<br></div></div><br></div></div></div></div></div>