- // Print out stdout and stderr only in debug mode
- debug_output (string ("\n") + standard_output + standard_error, true);
+ if (standard_output && standard_error)
+ {
+ // Print out stdout and stderr only in debug mode
+ debug_output (string ("\n") + standard_output + standard_error, true);
+ }
+
+ g_free (standard_error);
+ g_free (standard_output);