From a23bd24945bce5fa2d230f8064e5d0a525540a6f Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 8 Nov 2015 14:33:12 +0000 Subject: [PATCH] Moved variable definition into its proper ifdef case. Coverity CID 28702. --- xorriso/text_io.c | 7 ++++++- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xorriso/text_io.c b/xorriso/text_io.c index 23afaaeb..4b747f45 100644 --- a/xorriso/text_io.c +++ b/xorriso/text_io.c @@ -324,11 +324,12 @@ int Xorriso_dialog_input(struct XorrisO *xorriso, char line[], int linesize, bit5= write to history in any case (if it is enabled at compile time) */ { - char *cpt= NULL, **argv= NULL, *linept, *why_append= ""; + char **argv= NULL, *linept, *why_append= ""; int ret, argc= 0, base_length= 0, l, append_line; #ifdef Xorriso_with_line_editoR static char last_input[SfileadrL]= {""}; int no_history= 0; + char *cpt= NULL; #endif /* Xorriso_with_line_editoR */ double tdiff; struct timeval tv; @@ -478,8 +479,12 @@ put_into_history:; ret= 1; ex:; + +#ifdef Xorriso_with_line_editoR if(cpt!=NULL) free(cpt); +#endif + gettimeofday(&tv,&tz); xorriso->idle_time+= tv.tv_sec+(1.e-6*(double) tv.tv_usec)-tdiff; return(ret); diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 4d204441..44ad473e 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2015.11.08.140544" +#define Xorriso_timestamP "2015.11.08.143244"