From 362d6594a83dee9585d6c871919f31e4bf9dd734 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Fri, 11 May 2012 09:06:51 -0600 Subject: [PATCH] fix minor memory leak with default bootimage symbols --- src/bootimage.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/bootimage.cpp b/src/bootimage.cpp index a58f6a6af5..548b8bd39d 100644 --- a/src/bootimage.cpp +++ b/src/bootimage.cpp @@ -1826,10 +1826,10 @@ public: entryClass(0), entryMethod(0), entrySpec(0), - bootimageStart(strdup("_binary_bootimage_bin_start")), - bootimageEnd(strdup("_binary_bootimage_bin_end")), - codeimageStart(strdup("_binary_codeimage_bin_start")), - codeimageEnd(strdup("_binary_codeimage_bin_end")) + bootimageStart(0), + bootimageEnd(0), + codeimageStart(0), + codeimageEnd(0) { ArgParser parser; Arg classpath(parser, true, "cp", ""); @@ -1870,6 +1870,22 @@ public: exit(1); } + if(!bootimageStart) { + bootimageStart = strdup("_binary_bootimage_bin_start"); + } + + if(!bootimageEnd) { + bootimageEnd = strdup("_binary_bootimage_bin_end"); + } + + if(!codeimageStart) { + codeimageStart = strdup("_binary_codeimage_bin_start"); + } + + if(!codeimageEnd) { + codeimageEnd = strdup("_binary_codeimage_bin_end"); + } + } ~Arguments() {