From: Michael Jerris Date: Thu, 15 Sep 2011 14:48:37 +0000 (-0400) Subject: don't delete file if its the same file X-Git-Tag: v1.2-rc1~51^2~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61dd9c076533045422a73c5e8cd36d05bd381123;p=thirdparty%2Ffreeswitch.git don't delete file if its the same file --- diff --git a/src/switch_utils.c b/src/switch_utils.c index 1c49fb4104..3f3f804d77 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -570,7 +570,11 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to, char cmd[1024] = ""; switch_snprintf(cmd, sizeof(cmd), "%s %s %s", convert_cmd, file, newfile); switch_system(cmd, SWITCH_TRUE); - file = newfile; + if (strcmp(file, newfile)) { + file = newfile; + } else { + switch_safe_free(newfile); + } } switch_safe_free(dupfile);