[llvm-commits] [polly] r138203 - /polly/trunk/lib/Support/GICHelper.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Sat Aug 20 04:11:18 PDT 2011
Author: grosser
Date: Sat Aug 20 06:11:18 2011
New Revision: 138203
URL: http://llvm.org/viewvc/llvm-project?rev=138203&view=rev
Log:
GICHelper: Fix memory leaks, as we forgot to free some strings.
Modified:
polly/trunk/lib/Support/GICHelper.cpp
Modified: polly/trunk/lib/Support/GICHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/GICHelper.cpp?rev=138203&r1=138202&r2=138203&view=diff
==============================================================================
--- polly/trunk/lib/Support/GICHelper.cpp (original)
+++ polly/trunk/lib/Support/GICHelper.cpp Sat Aug 20 06:11:18 2011
@@ -62,7 +62,9 @@
std::string polly::stringFromIslObj(/*__isl_keep*/ isl_map *map) {
isl_printer *p = isl_printer_to_str(isl_map_get_ctx(map));
isl_printer_print_map(p, map);
- std::string string(isl_printer_get_str(p));
+ char *char_str = isl_printer_get_str(p);
+ std::string string(char_str);
+ free(char_str);
isl_printer_free(p);
return string;
}
@@ -70,7 +72,9 @@
std::string polly::stringFromIslObj(/*__isl_keep*/ isl_set *set) {
isl_printer *p = isl_printer_to_str(isl_set_get_ctx(set));
isl_printer_print_set(p, set);
- std::string string(isl_printer_get_str(p));
+ char *char_str = isl_printer_get_str(p);
+ std::string string(char_str);
+ free(char_str);
isl_printer_free(p);
return string;
}
@@ -78,7 +82,9 @@
std::string polly::stringFromIslObj(/*__isl_keep*/ isl_union_map *umap) {
isl_printer *p = isl_printer_to_str(isl_union_map_get_ctx(umap));
isl_printer_print_union_map(p, umap);
- std::string string(isl_printer_get_str(p));
+ char *char_str = isl_printer_get_str(p);
+ std::string string(char_str);
+ free(char_str);
isl_printer_free(p);
return string;
}
@@ -86,7 +92,9 @@
std::string polly::stringFromIslObj(/*__isl_keep*/ isl_union_set *uset) {
isl_printer *p = isl_printer_to_str(isl_union_set_get_ctx(uset));
isl_printer_print_union_set(p, uset);
- std::string string(isl_printer_get_str(p));
+ char *char_str = isl_printer_get_str(p);
+ std::string string(char_str);
+ free(char_str);
isl_printer_free(p);
return string;
}
@@ -95,7 +103,9 @@
isl_ctx *ctx = isl_union_map_get_ctx(isl_schedule_get_map(schedule));
isl_printer *p = isl_printer_to_str(ctx);
isl_printer_print_schedule(p, schedule);
- std::string string(isl_printer_get_str(p));
+ char *char_str = isl_printer_get_str(p);
+ std::string string(char_str);
+ free(char_str);
isl_printer_free(p);
return string;
}
More information about the llvm-commits
mailing list