<p>In <a href="https://github.com/geany/geany-plugins/pull/324#discussion_r49270663">lineoperations/src/linefunctions.c</a>:</p>
<pre style='color:#555'>> + for(j = 0; lines[i][j] != '\0'; j++)
> + newfile[nfposn++] = lines[i][j];
> + k = i;
> + }
> +
> + newfile[nfposn] = '\0';
> + sci_set_text(doc->editor->sci, newfile); // set new document
> +
> + }
> +
> +
> + // free used memory
> + for(i = 0; i < numlines; i++)
> + if(lines[i]) g_free(lines[i]);
> + if(lines) g_free(lines);
> + if(newfile) g_free(newfile);
</pre>
<p><code>g_free()</code> (like <code>free()</code>) is <code>NULL</code>-safe, no need for the test</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/geany/geany-plugins/pull/324/files#r49270663">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ23wRHHtR6rmuKVuWhn2_yNJNktUks5pYbVggaJpZM4HBhj7.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/geany/geany-plugins/pull/324/files#r49270663"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>