Skip to content

Commit e794f41

Browse files
committed
Fix crash daemon envelope ownership and event_json cleanup
1 parent a626e07 commit e794f41

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/backends/native/sentry_crash_daemon.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2280,6 +2280,7 @@ write_envelope_with_minidump(const sentry_options_t *options,
22802280
if (fd < 0) {
22812281
SENTRY_WARN("Failed to open envelope file for writing");
22822282
sentry_free(event_id);
2283+
sentry_free(event_json);
22832284
return false;
22842285
}
22852286

@@ -2333,8 +2334,8 @@ write_envelope_with_minidump(const sentry_options_t *options,
23332334
_write(fd, "\n", 1);
23342335
#endif
23352336
}
2336-
sentry_free(event_json);
23372337
}
2338+
sentry_free(event_json);
23382339

23392340
// Add minidump as attachment
23402341
#if defined(SENTRY_PLATFORM_UNIX)
@@ -2750,8 +2751,6 @@ sentry__process_crash(const sentry_options_t *options, sentry_crash_ipc_t *ipc)
27502751
SENTRY_WARN("No transport available for sending envelope");
27512752
sentry_envelope_free(envelope);
27522753
}
2753-
} else {
2754-
sentry_envelope_free(envelope);
27552754
}
27562755

27572756
// Clean up temporary envelope file (keep minidump for

0 commit comments

Comments
 (0)