]> git.sur5r.net Git - openocd/commitdiff
propagate error in dump_image. If an error occurs during dump_image, a tcl exception...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 14 May 2009 08:44:09 +0000 (08:44 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 14 May 2009 08:44:09 +0000 (08:44 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1782 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/target/target.c

index 68fad2fe89194c8f1d12e4bd9f30da2ae3ab6fab..a0cbf85c57cef729134eef0f75736d2575ec8d95 100644 (file)
@@ -2158,10 +2158,10 @@ static int handle_dump_image_command(struct command_context_s *cmd_ctx, char *cm
        if (retval==ERROR_OK)
        {
                command_print(cmd_ctx, "dumped %"PRIi64" byte in %s", fileio.size, duration_text);
+               free(duration_text);
        }
-       free(duration_text);
 
-       return ERROR_OK;
+       return retval;
 }
 
 static int handle_verify_image_command_internal(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc, int verify)