Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/majn/tgl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2016-02-18 22:12:10 +0300
committermjentsch <mtthsjntsch@gmail.com>2016-02-27 17:10:53 +0300
commitbec66c25d52368695e10625f956de5250a2d836d (patch)
tree0e6676da35291404e5e2bfdc236f1ee90e9be6ef
parente03d95bbdfecaec0aaca7dec60644ed9d8aeff08 (diff)
Fix use-after-not-created for photos
Fix reported by @spaeps in https://github.com/majn/telegram-purple/issues/238 Closes #42 I didn't actually do anything, except forward this patch.
-rw-r--r--structures.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/structures.c b/structures.c
index ff4c6cb..1e8a4c2 100644
--- a/structures.c
+++ b/structures.c
@@ -1966,7 +1966,7 @@ void tgls_free_message_media (struct tgl_state *TLS, struct tgl_message_media *M
case tgl_message_media_geo:
return;
case tgl_message_media_photo:
- tgls_free_photo (TLS, M->photo);
+ if (M->photo) { tgls_free_photo (TLS, M->photo); }
if (M->caption) { tfree_str (M->caption); }
M->photo = NULL;
return;