[geany/geany-plugins] fb53d8: lineoperations: Fix a memory leak found by cppcheck
Colomban Wendling
git-noreply at xxxxx
Tue Mar 8 11:21:32 UTC 2016
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Tue, 08 Mar 2016 11:21:32 UTC
Commit: fb53d8cd72868a24da5a0e9e0abbb36febdee53b
https://github.com/geany/geany-plugins/commit/fb53d8cd72868a24da5a0e9e0abbb36febdee53b
Log Message:
-----------
lineoperations: Fix a memory leak found by cppcheck
Modified Paths:
--------------
lineoperations/src/linefunctions.c
Modified: lineoperations/src/linefunctions.c
4 lines changed, 0 insertions(+), 4 deletions(-)
===================================================================
@@ -286,17 +286,13 @@ void rmwhspln(GeanyDocument *doc) {
/* Sort Lines Ascending and Descending */
void sortlines(GeanyDocument *doc, gboolean asc) {
- gint total_num_chars; /* number of characters in the document */
gint total_num_lines; /* number of lines in the document */
gchar **lines; /* array to hold all lines in the document */
gchar *new_file; /* *final* string to replace current document */
gint i; /* iterator */
- total_num_chars = sci_get_length(doc->editor->sci);
total_num_lines = sci_get_line_count(doc->editor->sci);
lines = g_malloc(sizeof(gchar *) * (total_num_lines+1));
- new_file = g_malloc(sizeof(gchar) * (total_num_chars+1));
- new_file[0] = '\0';
/* if file is not empty, ensure that the file ends with newline */
if(total_num_lines != 1)
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list