> + 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);
`g_free()` (like `free()`) is `NULL`-safe, no need for the test --- Reply to this email directly or view it on GitHub: https://github.com/geany/geany-plugins/pull/324/files#r49270663
