Michael Lotz
246a908734
* CID 1012: Fix leaking the OffsetFile in case it fails to initialize.
...
* Use std::nothrow (the rest of the file already used it).
* We also have to keep the source file around and properly dispose it, as
OffsetFile doesn't take ownership of it.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27486 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 16:30:48 +00:00
Michael Lotz
062952adf7
Initialize fFile to NULL.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27485 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 16:26:02 +00:00
Michael Lotz
3e8d3c5f98
* CID 1090: Check the view pointer for NULL before dereferencing it.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27484 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 15:55:15 +00:00
Michael Lotz
fccbe8f1a1
* CID 525: Check the return of _UpdateModeList() as otherwise fModeList can
...
still be NULL although it is used further down.
* CID 526: Check the front buffer to be available before using it in SetMode().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27483 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 15:51:16 +00:00
Michael Lotz
7c618f130f
Remove accidentally introduced whitespace in last commit.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27482 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 15:30:19 +00:00
Michael Lotz
8050519bed
CID 157: Fix usage of *covers instead of cover which in this case indeed is NULL
...
and should have lead to a crash.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27481 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 15:28:31 +00:00
Michael Lotz
4071a5a97b
CID 930: Fix memory leak in error case.
...
Note that this file has a completely different coding style, violating ours for
consistency until the whole file can be cleaned up.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27480 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 15:22:30 +00:00
Michael Lotz
84cd8e6902
CID 1251: If the NetStack::Init() fails, return the corresponding error instead
...
of setting the global net stack to a deleted value.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 14:41:42 +00:00
Michael Lotz
2391ca5568
CID 56: Fix the wrong NULL check.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27478 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 14:27:31 +00:00
Stephan Aßmus
ebcba0bec8
Free query in error code path. Fixes CID 927.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 14:04:13 +00:00
Michael Lotz
3ba6733d61
* CID 312 and CID 313: The device can be NULL in ReadLockPartition().
...
* CID 314 and CID 315: Same as above just for WriteLockPartition.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27476 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 13:57:40 +00:00
Michael Lotz
b1effc0c77
CID 316: If path can be null, path->InitCheck() shouldn't be used. Split it up
...
into two seperate checks instead and return B_BAD_VALUE on a passed NULL path.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27475 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 13:43:50 +00:00
Michael Lotz
020f56a07f
CID 323 and CID 324: Also check the results of these dynamic_casts, sorry for
...
not combining with the previous commit.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27474 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 12:36:17 +00:00
Michael Lotz
446d046c5e
CID 325: Be defensive and check the results of the dynamic_casts.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27473 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 12:28:46 +00:00
Ingo Weinhold
034fb25c4d
* The image was create one byte too short. Fixes #2722 .
...
* Automatic whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 10:04:51 +00:00
Axel Dörfler
57b9debf76
* Some index updating functions did not take into account that not all nodes
...
are put into all indices. For example, symlinks aren't part of the size
index. This fixes bug #2704 .
* Also, Inode::NeedsTrimming() now ignores symlinks that have no data stream,
it's const now, too.
* Added helper methods Inode::In{Name|Size|LastModified}Index(), and use it
where appropriate.
* Clarified Inode::Create() description with regards to name vs. parent.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 09:47:55 +00:00
Michael Lotz
bdff2c8222
* CID 1044: Add more explicit NULL check before dereferencing in TRACE statement.
...
* Whitespace cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27470 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 00:44:12 +00:00
Michael Lotz
4e9bf24dd5
CID 26: The status variable was shadowed inside the while loop causing the outer
...
status to always be B_OK, resulting in an incomplete buffer instead of an error
if the append failed.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27469 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 00:28:29 +00:00
Michael Lotz
0c397beb9c
CID 1021: Move NULL check before dereferencing "string" in the TRACE statement.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27468 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 00:10:40 +00:00
Michael Lotz
d02cde3053
CID 877: Fix memory leak in error case.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27467 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 00:06:59 +00:00
Michael Lotz
2c0a05cce1
CID 1258: This was probably missed when replacing all "write" with
...
operation->IsWrite().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27466 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-13 00:01:48 +00:00
Fredrik Modeen
a426099957
fixes CID 455 Check for NULL and use std::nothrow
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27465 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 19:08:31 +00:00
Fredrik Modeen
2d9f1f59b3
fixes pointed by Axel and some stile changes.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27464 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:29:30 +00:00
Fredrik Modeen
327a88fbc1
fixes pointed out by Axel, and style changes.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27463 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:29:16 +00:00
Fredrik Modeen
80f39d66d4
fixes pointed out by Michael and Axel, thanks for pointing those out.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27462 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:06:52 +00:00
Michael Lotz
b57520d4a9
* Don't leak the decoded instructions in case the device object cannot be
...
allocated.
* Remove accidentally added debug device id.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27461 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 18:02:07 +00:00
Stephan Aßmus
8008c36e34
Fixed CID 1272. Looks like _addressLength is allowed to be NULL, but
...
at function exit, it was still dereferenced.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27460 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 17:31:48 +00:00
Stephan Aßmus
870dc73f78
Fixed CID 1292. If the allocation or adding to the list of the very first Buffer failed,
...
the buffer data would be leaked. Note that for failure to allocate later buffers, the
data is correctly freed in _FreeBuffers().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27459 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 17:24:32 +00:00
Michael Lotz
0a28b4e324
CID 1261: The "previous" list entry wasn't maintained, causing lost list items
...
when removing a non-first element.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27458 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 17:17:29 +00:00
Michael Lotz
5565f43e07
Check the allocation of the endpoint pipe object.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27457 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 17:10:35 +00:00
Michael Lotz
11b9aad7f7
* Use new(std::nothrow) everywhere (NULL checks were already there).
...
* Fix a warning if trace output is not enabled.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27456 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 17:00:28 +00:00
Michael Lotz
8395debafa
* CID 7: The fObjectArray that holds the usb_id to object association was never
...
freed.
* Also the allocation of said array was not checked.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27455 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 16:48:41 +00:00
Stephan Aßmus
67710adc92
Fixed CID 1303. The config message was dereferenced in the constructor list.
...
I don't know if it can be NULL at all, but let's be defensive. It was
already checked later anyways.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27454 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 16:29:52 +00:00
Fredrik Modeen
f1ca556caf
Fixed CID 321, 868: check item for NULL and delete recource leak
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27453 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 14:15:47 +00:00
Fredrik Modeen
ee652e3aab
reverted to 11769 and added (std::nothrow)
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 14:06:56 +00:00
Ryan Leavengood
dd84bf1de8
Reverting r27437 as per Axel's advice. The variable size is initialized by the
...
call to ElementAt. Marked CID 1306 as false.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27451 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 13:46:50 +00:00
Ryan Leavengood
c2a59f2305
Remove the null check as per Axel's advice: valid arguments within the range
...
are never null.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27450 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 13:44:00 +00:00
Axel Dörfler
90e8094e1e
* Added test application for the AttributeIterator implementation. Note that
...
this test fails under BeOS, while it works just fine under Haiku.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27449 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 12:23:39 +00:00
Fredrik Modeen
ba65711eb2
Fixed CID 1033: fMouseDownBounds will never be null as we do a new BBitmap before we check for NULL
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27448 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 11:32:40 +00:00
Stefano Ceccherini
1e8da5fd15
fAppName was leaked (CID 6). Also moved the initialization of fText to the end of the function, so that we avoid a BString::Adopt() call
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27447 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 10:26:05 +00:00
Stefano Ceccherini
746cac055a
fixed buffer overrun, CID 649
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27446 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 10:10:13 +00:00
Stefano Ceccherini
b5d458a508
First round of style changes: renamed all member variables from m_var_name to fVarName
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 09:55:02 +00:00
Axel Dörfler
fa23653d48
* Improved reported inode number to the be actual index.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27444 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 09:53:58 +00:00
Stefano Ceccherini
866ece3115
build fix
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27443 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 09:34:47 +00:00
Stefano Ceccherini
1adaf58e1f
gcc4 noticed GenericThread::GetName() was returning a pointer to a local variable. No code is using this function, so it's safe to strdup() it. This class needs a serious restyling, though, as it doesn't conform to our coding guidelines
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27442 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 09:33:59 +00:00
Axel Dörfler
c4b2fd5be3
* Reverted r27196 and solved it differently (in a more robust way): instead of
...
guessing that the first attribute will be a name attribute, fCurrentSmallData
now takes hidden attributes into account.
* I haven't tested this change, though, so if it messes things up again, please
yell at me :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27441 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 09:25:17 +00:00
Stefano Ceccherini
2e2bff94a9
buttons could be used initialized if locking the looper failed (CID 1134)
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27440 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 08:09:13 +00:00
Stefano Ceccherini
fc16834e55
buffer is an array, so use delete[]. CID 130
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27439 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 07:34:37 +00:00
Fredrik Modeen
c1d9a877a4
Fixed CID 1031: removed check _fDevice for NULL as we do new BList in constructor also removed temp var count as _fDevice->CountItems() should return 0 if empty
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27438 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 07:07:00 +00:00
Ryan Leavengood
52a542adfc
Fixed CID 1306: initialize size to 0.
...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27437 a95241bf-73f2-0310-859d-f6bbb57e9c96
2008-09-12 06:43:07 +00:00