Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
466aa0bd
Commit
466aa0bd
authored
Sep 18, 2014
by
Vysheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed small memory leaks
parent
1789aa3c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
binlog.c
binlog.c
+2
-0
main.c
main.c
+1
-1
structures.c
structures.c
+8
-1
No files found.
binlog.c
View file @
466aa0bd
...
@@ -266,6 +266,7 @@ static int fetch_comb_binlog_user_set_full_photo (void *extra) {
...
@@ -266,6 +266,7 @@ static int fetch_comb_binlog_user_set_full_photo (void *extra) {
tgls_free_photo
(
&
U
->
user
.
photo
);
tgls_free_photo
(
&
U
->
user
.
photo
);
}
}
tglf_fetch_photo
(
&
U
->
user
.
photo
);
tglf_fetch_photo
(
&
U
->
user
.
photo
);
U
->
flags
|=
FLAG_HAS_PHOTO
;
if
(
tgl_state
.
callback
.
user_update
)
{
if
(
tgl_state
.
callback
.
user_update
)
{
tgl_state
.
callback
.
user_update
((
void
*
)
U
,
TGL_UPDATE_PHOTO
);
tgl_state
.
callback
.
user_update
((
void
*
)
U
,
TGL_UPDATE_PHOTO
);
...
@@ -655,6 +656,7 @@ static int fetch_comb_binlog_chat_set_full_photo (void *extra) {
...
@@ -655,6 +656,7 @@ static int fetch_comb_binlog_chat_set_full_photo (void *extra) {
tgls_free_photo
(
&
C
->
chat
.
photo
);
tgls_free_photo
(
&
C
->
chat
.
photo
);
}
}
tglf_fetch_photo
(
&
C
->
chat
.
photo
);
tglf_fetch_photo
(
&
C
->
chat
.
photo
);
C
->
flags
|=
FLAG_HAS_PHOTO
;
if
(
tgl_state
.
callback
.
chat_update
)
{
if
(
tgl_state
.
callback
.
chat_update
)
{
tgl_state
.
callback
.
chat_update
((
void
*
)
C
,
TGL_UPDATE_PHOTO
);
tgl_state
.
callback
.
chat_update
((
void
*
)
C
,
TGL_UPDATE_PHOTO
);
...
...
main.c
View file @
466aa0bd
...
@@ -336,7 +336,7 @@ void parse_config (void) {
...
@@ -336,7 +336,7 @@ void parse_config (void) {
strcpy
(
buf
+
l
,
"binlog_enabled"
);
strcpy
(
buf
+
l
,
"binlog_enabled"
);
config_lookup_bool
(
&
conf
,
buf
,
&
binlog_enabled
);
config_lookup_bool
(
&
conf
,
buf
,
&
binlog_enabled
);
int
pfs_enabled
;
int
pfs_enabled
=
0
;
strcpy
(
buf
+
l
,
"pfs_enabled"
);
strcpy
(
buf
+
l
,
"pfs_enabled"
);
config_lookup_bool
(
&
conf
,
buf
,
&
pfs_enabled
);
config_lookup_bool
(
&
conf
,
buf
,
&
pfs_enabled
);
if
(
pfs_enabled
)
{
if
(
pfs_enabled
)
{
...
...
structures.c
View file @
466aa0bd
...
@@ -1476,7 +1476,6 @@ void tgls_free_photo_size (struct tgl_photo_size *S) {
...
@@ -1476,7 +1476,6 @@ void tgls_free_photo_size (struct tgl_photo_size *S) {
}
}
void
tgls_free_photo
(
struct
tgl_photo
*
P
)
{
void
tgls_free_photo
(
struct
tgl_photo
*
P
)
{
if
(
!
P
->
access_hash
)
{
return
;
}
if
(
P
->
caption
)
{
tfree_str
(
P
->
caption
);
}
if
(
P
->
caption
)
{
tfree_str
(
P
->
caption
);
}
if
(
P
->
sizes
)
{
if
(
P
->
sizes
)
{
int
i
;
int
i
;
...
@@ -1488,12 +1487,18 @@ void tgls_free_photo (struct tgl_photo *P) {
...
@@ -1488,12 +1487,18 @@ void tgls_free_photo (struct tgl_photo *P) {
}
}
void
tgls_free_video
(
struct
tgl_video
*
V
)
{
void
tgls_free_video
(
struct
tgl_video
*
V
)
{
tfree_str
(
V
->
mime_type
);
if
(
!
V
->
access_hash
)
{
return
;
}
if
(
!
V
->
access_hash
)
{
return
;
}
tfree_str
(
V
->
caption
);
tfree_str
(
V
->
caption
);
tgls_free_photo_size
(
&
V
->
thumb
);
tgls_free_photo_size
(
&
V
->
thumb
);
}
}
void
tgls_free_audio
(
struct
tgl_audio
*
A
)
{
tfree_str
(
A
->
mime_type
);
}
void
tgls_free_document
(
struct
tgl_document
*
D
)
{
void
tgls_free_document
(
struct
tgl_document
*
D
)
{
tfree_str
(
D
->
mime_type
);
if
(
!
D
->
access_hash
)
{
return
;
}
if
(
!
D
->
access_hash
)
{
return
;
}
tfree_str
(
D
->
caption
);
tfree_str
(
D
->
caption
);
tfree_str
(
D
->
mime_type
);
tfree_str
(
D
->
mime_type
);
...
@@ -1504,7 +1509,9 @@ void tgls_free_message_media (struct tgl_message_media *M) {
...
@@ -1504,7 +1509,9 @@ void tgls_free_message_media (struct tgl_message_media *M) {
switch
(
M
->
type
)
{
switch
(
M
->
type
)
{
case
tgl_message_media_none
:
case
tgl_message_media_none
:
case
tgl_message_media_geo
:
case
tgl_message_media_geo
:
return
;
case
tgl_message_media_audio
:
case
tgl_message_media_audio
:
tgls_free_audio
(
&
M
->
audio
);
return
;
return
;
case
tgl_message_media_photo
:
case
tgl_message_media_photo
:
tgls_free_photo
(
&
M
->
photo
);
tgls_free_photo
(
&
M
->
photo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment