<p>In <a href="https://github.com/geany/geany-plugins/pull/324#discussion_r49270637">lineoperations/src/linefunctions.c</a>:</p>
<pre style='color:#555'>> +    gint  numlines;         // number of lines in **lines array
> +  gchar *newfile;         // *final* string to replace current document
> +  gint  nfposn;           // keeps track of the position of newfile string
> +  gint  i;                // iterator
> +  gint  j;                // iterator
> +  gint  k;                // iterator
> +
> +  totalnumchars = sci_get_length(doc->editor->sci);
> +  totalnumlines = sci_get_line_count(doc->editor->sci);
> +  lines         = g_malloc(sizeof(gchar *) * totalnumlines);
> +  newfile       = g_malloc(sizeof(gchar) * (totalnumchars+1));
> +  numlines      = 0;
> +  nfposn        = 0;
> +  k             = 0;
> +
> +  if(newfile && lines)    // verify memory allocation
</pre>
<p><code>g_malloc()</code> aborts on failure.  If you really mean to support allocation failure you need to use <code>g_try_malloc()</code> instead (no need unless you allocate really large data, as on very low memory situations something in GLib/GTK/Geany will most likely abort anyway).</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#r49270637">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJwxrrPFwhdMVxch5wOwL26oHM2yFks5pYbRPgaJpZM4HBhj7.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#r49270637"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>