Patch Set 2: Code-Review+2

(1 comment)
File openbsc/src/libmsc/gsm_04_11.c:

Line 637:       rc = sms_route_mt_sms(conn, sms_report);
> if mem is up, the program will likely not do *anything* useful anymore. Ins
It is our general practise/consensus that we should not try to resolve memory 
allocation failures.  There is some old code that does try to cope with it, and 
most probably in a bad way.  So indeed, I think the best approach to deal with 
allocation failures is to terminate the program.  WE don't allocate large 
amounts of memory anyway, and if our small allocations fail, the system is 
beyond hope.  The difference to the kernel is that the NITB/MSC/... process 
will simply be restarted very quickly, without having an impact on other 
processes on the system.  And if we have a leak, we should fix it, and users 
should complain with a meaningful error message (e.g. the assert).

We could consider moving the ASSERT()s into the allocator, or have something 
like talloc macros that assert if they fail. But that's outside of the scope of 
this patch.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso <>
Gerrit-Reviewer: Harald Welte <>
Gerrit-Reviewer: Holger Freyther <>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Keith Whyte <>
Gerrit-Reviewer: Neels Hofmeyr <>
Gerrit-Reviewer: Pablo Neira Ayuso <>
Gerrit-HasComments: Yes

Reply via email to