]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't delete file if its the same file
authorMichael Jerris <mike@jerris.com>
Thu, 15 Sep 2011 14:48:37 +0000 (10:48 -0400)
committerMichael Jerris <mike@jerris.com>
Thu, 15 Sep 2011 14:48:37 +0000 (10:48 -0400)
src/switch_utils.c

index 1c49fb410411457dfff9ebf68d81f42f6b988efa..3f3f804d77a3388b8184e4c1f074b1f4911dd01a 100644 (file)
@@ -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);