File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ int Rast_put_cell_title(const char *name, const char *title)
35
35
if (!out ) {
36
36
fclose (in );
37
37
G_warning (_ ("G_put_title - can't create a temp file" ));
38
+ G_free (tempfile );
38
39
return -1 ;
39
40
}
40
41
@@ -52,12 +53,15 @@ int Rast_put_cell_title(const char *name, const char *title)
52
53
if (line < 3 ) {
53
54
G_warning (_ ("category information for [%s] in [%s] invalid" ), name ,
54
55
mapset );
56
+ remove (tempfile );
57
+ G_free (tempfile );
55
58
return -1 ;
56
59
}
57
60
58
61
in = fopen (tempfile , "r" );
59
62
if (!in ) {
60
63
G_warning (_ ("G_put_title - can't reopen temp file" ));
64
+ G_free (tempfile );
61
65
return -1 ;
62
66
}
63
67
@@ -66,6 +70,8 @@ int Rast_put_cell_title(const char *name, const char *title)
66
70
fclose (in );
67
71
G_warning (_ ("can't write category information for [%s] in [%s]" ), name ,
68
72
mapset );
73
+ remove (tempfile );
74
+ G_free (tempfile );
69
75
return -1 ;
70
76
}
71
77
@@ -75,6 +81,7 @@ int Rast_put_cell_title(const char *name, const char *title)
75
81
fclose (in );
76
82
fclose (out );
77
83
remove (tempfile );
84
+ G_free (tempfile );
78
85
79
86
return 1 ;
80
87
}
You can’t perform that action at this time.
0 commit comments