Commit Graph

157 Commits

Author SHA1 Message Date
Armin Novak
855dc9abaf Clear message queue on free. 2018-02-09 10:29:18 +01:00
Armin Novak
7305828122 Fix #4239: Various memory leaks
* Fixed all tests, now can be run with -DWITH_ADDRESS_SANITIZER=ON compiled.
* Enabled address sanitizer for nightly builds.
2017-12-12 11:40:48 +01:00
Armin Novak
bcfa434da2 Fixed resizing of PubSub 2017-09-25 13:33:04 +02:00
Armin Novak
0490aeb018 Fixed clang malloc integer overflow warnings. 2017-07-20 09:29:48 +02:00
Alexander Zakharov
3f139108ff Fix Stack_Peek 2017-03-13 15:45:27 +03:00
pony
a57adc3fde libwinpr-utils: fix 3 logic errors 2017-02-15 10:08:53 +01:00
Marc-André Moreau
915b9a15b1 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	winpr/libwinpr/bcrypt/CMakeLists.txt
2016-05-11 11:05:17 -04:00
Armin Novak
ee186bec73 ListDictionary handle NULL list argument. 2016-04-26 09:34:12 +02:00
Marc-André Moreau
d0f413db12 winpr: initial port to Universal Windows Platform (UWP) 2016-02-05 16:28:45 -05:00
Martin Haimberger
008d9f3b79 fixed misc *_free functions to accept NULL
Following types of collections support now
NULL in the free call:

* ArrayList
* BitStream
* ContdownEvent
* Dictionary
* KeyValuePair
* MessageQueue
2015-07-30 07:02:36 -07:00
Armin Novak
6698e24228 Fixed leaks, NULL dereferences and broken init. 2015-06-23 21:29:21 +02:00
David FORT
16d36e3083 A malloc() pass on WinPR
This patch treats remaining non-checked mallocs. And changes to calloc in places
where it makes sense
2015-06-22 19:10:00 +02:00
David FORT
12f873f1f9 Fixed MessageQueue and callers 2015-05-29 14:24:14 +02:00
Hardening
f8120919af Add checks for some XXX_New and XXX_Add functions
Based on PR #2616
2015-05-18 11:28:00 +02:00
Norbert Federa
1eff1a345e free can handle NULL perfectly fine 2015-05-11 09:07:39 +02:00
Norbert Federa
ef1fd12b15 Fix unchecked CreateEvent calls and misc fixes
1)
Added missing checks for CreateEvent which also required the
following related changes:

- changed freerdp_context_new API to BOOL
- changed freerdp_peer_context_new API to BOOL
- changed pRdpClientNew callback to BOOL
- changed pContextNew callback to BOOL
- changed psPeerAccepted callback to BOOL
- changed psPeerContextNew callback to BOOL

2)
Fixed lots of missing alloc and error checks in the
changed code's neighbourhood.

3)
Check freerdp_client_codecs_prepare result to avoid segfaults
caused by using non-initialized codecs.

4)
Fixed deadlocks in x11 caused by missing xf_unlock_x11() calls
in some error handlers

5)
Some fixes in thread pool:
- DEFAULT_POOL assignment did not match TP_POOL definition
- don't free the pool pointer if it points to the static DEFAULT_POOL
- added error handling and cleanup in InitializeThreadpool
2015-04-29 18:18:39 +02:00
Bernhard Miklautz
1093f647d3 ObjectPool: fix regression
winpr allocation checks introduced a problem that lead to zero size
allocations in ObjectPool
2015-04-14 13:47:23 +02:00
Bernhard Miklautz
a8c44f15c0 winpr: small fixes and cleanups
Update the pull request and integrate the latest comments and
suggestions.

* TestLibrary*: fix typo in error message
* TestPipeCreateNamedPipeOverlapped: free possibly allocated memory
* smartcard_pcsc.c: format fix
* process.c: add missing NULL check
* MessageQueue.c: delete possibly initialized critical section on error
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
850de59b55 winpr: add checks for *alloc
Add missing checks if memory allocation was successful. Also adapt
caller(s) when possible.
2015-04-08 11:34:37 +02:00
Bernhard Miklautz
f469e069dc stream: Stream_Ensure*Capacity: change return type
Change the return type of Stream_Ensure*Capacity from void to BOOL to be
able to detect realloc problems easily. Otherwise the only way to detect
this was to check if the capacity after the call was >= the required
size.
In case Stream_Ensure*Capacity fails the old memory is still available
and need to freed outside.

This commit also adds checks to most calls of Stream_Ensure*Capacity to
check if the call was successful.
2015-03-30 16:33:48 +02:00
Bernhard Miklautz
1d7b3694a9 Integrate feedback from pull request (#2492)
* shell: add missing NULL checks
* thread: handle case where HAVE_EVENTFD_H isn't defined
* wlog: return NULL instead of 0
* wlog: use g_RootLog instead of WLog_GetRoot
  otherwise a new root might be initialized on uninit
* indentation and style fixes
2015-03-25 17:38:21 +01:00
Bernhard Miklautz
3c7662517c hardening
Start to add missing checks for:
* *alloc
* *_New
2015-03-25 17:38:21 +01:00
Marc-André Moreau
9562439bd8 libfreerdp-codec: add support for 1bpp image copy 2015-03-16 13:27:27 -04:00
Marc-André Moreau
f226c27fb0 libwinpr-utils: improve BipBuffer 2015-03-13 20:22:21 -04:00
Marc-André Moreau
34181949e6 libwinpr-utils: update BipBuffer 2015-03-13 18:37:48 -04:00
Marc-André Moreau
afdd55fa81 Merge branch 'master' of github.com:FreeRDP/FreeRDP 2015-03-13 15:30:31 -04:00
Marc-André Moreau
1222da4a86 libwinpr-utils: initial BipBuffer implementation 2015-03-12 16:34:48 -04:00
Marc-André Moreau
5ab34dfa3e Merge pull request #2456 from zhangzl2013/fix-realloc
Fix incorrect usage of realloc
2015-03-12 07:33:27 -04:00
Armin Novak
ac16811e46 Fixed PubSub_Unsubscribe. 2015-03-11 12:28:07 +01:00
Armin Novak
06df5049a7 Fixed missing loop exit condition. 2015-03-11 11:33:17 +01:00
Zhang Zhaolong
512865011d libwinpr: check return value of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 16:34:38 +08:00
Zhang Zhaolong
19f2354ee4 fix build error.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 15:04:38 +08:00
Zhang Zhaolong
e30d1c0f47 libwinpr: fix incorrect usage of realloc.
Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>
2015-03-11 14:59:56 +08:00
Marc-André Moreau
22ac46957a xfreerdp: fix egfx multimonitor support 2015-02-10 16:32:07 -05:00
Marc-André Moreau
85191391d5 libfreerdp-core: simplify TS Gateway RPC fragment receiving 2015-01-31 16:56:25 -05:00
Marc-André Moreau
cc2321d359 libfreerdp-core: fix leak and use after free in tsg ListDictionary usage 2014-12-11 17:08:22 -05:00
Marc-André Moreau
d8e10ac04a freerdp: patch leaks reported by valgrind when using TS Gateway 2014-12-11 11:25:34 -05:00
Armin Novak
d525999a06 Fixed allocation size warning. 2014-11-16 23:43:18 +01:00
Armin Novak
d225b97078 Fixed allocation size warning. 2014-11-16 23:42:30 +01:00
Armin Novak
2671482458 Fixed Stack_Free. 2014-11-16 16:48:50 +01:00
Armin Novak
cf5b9a75b8 Fixed memory leak 2014-11-16 15:03:20 +01:00
Marc-André Moreau
11ae267518 libfreerdp-core: expose new API to allow FreeRDS virtual channel hooking 2014-10-10 16:11:42 -04:00
Marc-André Moreau
b01ef89b3d libwinpr-utils: improve HashTable flexibility, add proper string support 2014-10-09 16:46:55 -04:00
Marc-André Moreau
bbf4732470 Merge branch 'master' of github.com:FreeRDP/FreeRDP
Conflicts:
	libfreerdp/gdi/gdi.c
2014-09-25 10:34:56 -04:00
Bernhard Miklautz
7bd62a0127 winpr-utils: fix problem in LinkedList enumerator
A segfault can happen if LinkedList_Enumerator_MoveNext is invoked
before LinkedList_Enumerator_Reset was called.
2014-09-24 12:31:52 +02:00
Marc-André Moreau
09fc388e03 shadow: add RefreshRect/SuppressOutput support 2014-09-18 22:18:58 -04:00
Bernhard Miklautz
2218e9684a Fix: misc compiler warnings
Seen in Xcode
2014-09-12 00:36:29 +02:00
Armin Novak
41e7fdd95f Fixed missing initialisation of position variable. 2014-09-09 16:33:05 +02:00
Armin Novak
a15df299e9 Removed last remainig printf. 2014-09-09 16:32:23 +02:00
Marc-André Moreau
065d6f0c99 Merge pull request #2010 from hardening/list_return_value
Make LinkedList return errors when something fails
2014-08-18 13:05:18 -04:00