aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-01-23 15:36:37 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-25 19:44:54 +0000
commitd0ef1ed78cc4e8e04296342499991fdde77fbbe7 (patch)
tree9d49d8ca75051c446511b1462022b66d16a9c8dc /openbsc/src/gprs
parentf6e51709fc3a79274646135fec1a603d4316acf6 (diff)
compression: Fix nullpointer deref
When the creation of a new compression entity fails, an error message is created, this error message contains printf with a dereferentiation of the compression entity, that is clearly NULL at that point. This commit corrects that. Change-Id: I87371ade0ccd6a93b446f2013c1747f486739518
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gprs_sndcp_comp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/openbsc/src/gprs/gprs_sndcp_comp.c
index 1591f803c..a12c39aa6 100644
--- a/openbsc/src/gprs/gprs_sndcp_comp.c
+++ b/openbsc/src/gprs/gprs_sndcp_comp.c
@@ -107,13 +107,14 @@ static struct gprs_sndcp_comp *gprs_sndcp_comp_create(const void *ctx,
}
}
- /* Display info message */
+ /* Bail on failure */
if (comp_entity == NULL) {
LOGP(DSNDCP, LOGL_ERROR,
- "Compression entity (%d) creation failed!\n",
- comp_entity->entity);
+ "Compression entity creation failed!\n");
return NULL;
}
+
+ /* Display info message */
if (comp_entity->compclass == SNDCP_XID_PROTOCOL_COMPRESSION) {
LOGP(DSNDCP, LOGL_INFO,
"New header compression entity (%d) created.\n",