Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
dde4e763
Commit
dde4e763
authored
Jul 22, 2019
by
Ulrich Sibiller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Image.c: use SAFE_free
parent
45853801
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
15 deletions
+12
-15
Image.c
nx-X11/programs/Xserver/hw/nxagent/Image.c
+12
-15
No files found.
nx-X11/programs/Xserver/hw/nxagent/Image.c
View file @
dde4e763
...
@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
...
@@ -455,7 +455,7 @@ FIXME: Here the split trap is always set and so the caching of
if
(
nxagentUnpackAlpha
[
resource
]
!=
NULL
)
if
(
nxagentUnpackAlpha
[
resource
]
!=
NULL
)
{
{
free
(
nxagentUnpackAlpha
[
resource
]
->
data
);
SAFE_
free
(
nxagentUnpackAlpha
[
resource
]
->
data
);
}
}
else
if
((
nxagentUnpackAlpha
[
resource
]
=
malloc
(
sizeof
(
UnpackAlphaRec
)))
==
NULL
)
else
if
((
nxagentUnpackAlpha
[
resource
]
=
malloc
(
sizeof
(
UnpackAlphaRec
)))
==
NULL
)
{
{
...
@@ -463,7 +463,7 @@ FIXME: Here the split trap is always set and so the caching of
...
@@ -463,7 +463,7 @@ FIXME: Here the split trap is always set and so the caching of
fprintf
(
stderr
,
"nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.
\n
"
);
fprintf
(
stderr
,
"nxagentSetUnpackAlpha: PANIC! Can't allocate data for the alpha structure.
\n
"
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
return
;
return
;
}
}
...
@@ -483,7 +483,7 @@ FIXME: Here the split trap is always set and so the caching of
...
@@ -483,7 +483,7 @@ FIXME: Here the split trap is always set and so the caching of
resource
,
size
);
resource
,
size
);
#endif
#endif
free
(
data
);
SAFE_
free
(
data
);
}
}
}
}
...
@@ -1567,20 +1567,20 @@ nxagentPutSubImageEnd:
...
@@ -1567,20 +1567,20 @@ nxagentPutSubImageEnd:
nxagentImageStatistics
.
totalEncoded
,
nxagentImageStatistics
.
totalAdded
);
nxagentImageStatistics
.
totalEncoded
,
nxagentImageStatistics
.
totalAdded
);
#endif
#endif
free
(
packedChecksum
);
SAFE_
free
(
packedChecksum
);
if
(
packedImage
!=
NULL
)
if
(
packedImage
!=
NULL
)
{
{
if
(
packedImage
->
data
!=
NULL
&&
if
(
packedImage
->
data
!=
NULL
&&
packedImage
->
data
!=
plainImage
->
data
)
packedImage
->
data
!=
plainImage
->
data
)
{
{
free
(
packedImage
->
data
);
SAFE_
free
(
packedImage
->
data
);
}
}
free
(
packedImage
);
SAFE_
free
(
packedImage
);
}
}
free
(
plainImage
);
SAFE_
free
(
plainImage
);
}
}
void
nxagentGetImage
(
DrawablePtr
pDrawable
,
int
x
,
int
y
,
int
w
,
int
h
,
void
nxagentGetImage
(
DrawablePtr
pDrawable
,
int
x
,
int
y
,
int
w
,
int
h
,
...
@@ -1634,11 +1634,8 @@ void nxagentResetAlphaCache(void)
...
@@ -1634,11 +1634,8 @@ void nxagentResetAlphaCache(void)
{
{
if
(
nxagentUnpackAlpha
[
i
])
if
(
nxagentUnpackAlpha
[
i
])
{
{
free
(
nxagentUnpackAlpha
[
i
]
->
data
);
SAFE_free
(
nxagentUnpackAlpha
[
i
]
->
data
);
SAFE_free
(
nxagentUnpackAlpha
[
i
]);
free
(
nxagentUnpackAlpha
[
i
]);
nxagentUnpackAlpha
[
i
]
=
NULL
;
}
}
}
}
}
}
...
@@ -1716,7 +1713,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
...
@@ -1716,7 +1713,7 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
if
(
newImage
->
data
==
NULL
)
if
(
newImage
->
data
==
NULL
)
{
{
free
(
newImage
);
SAFE_
free
(
newImage
);
#ifdef PANIC
#ifdef PANIC
fprintf
(
stderr
,
"nxagentScaleImage: PANIC! Failed to create the target image data.
\n
"
);
fprintf
(
stderr
,
"nxagentScaleImage: PANIC! Failed to create the target image data.
\n
"
);
...
@@ -1784,8 +1781,8 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
...
@@ -1784,8 +1781,8 @@ int nxagentScaleImage(int x, int y, unsigned xRatio, unsigned yRatio,
}
}
}
}
free
((
char
*
)
image
->
obdata
);
SAFE_free
(
image
->
obdata
);
free
((
char
*
)
image
);
SAFE_free
(
image
);
*
pImage
=
newImage
;
*
pImage
=
newImage
;
...
...
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