X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Ftools%2Fperf%2Futil%2Ftrace-event-scripting.c;fp=kernel%2Ftools%2Fperf%2Futil%2Ftrace-event-scripting.c;h=a2fd6e79d5a5c5bb8e35f587e3e695e4f611879d;hb=52f993b8e89487ec9ee15a7fb4979e0f09a45b27;hp=9df61059a85d2188f9d0deb5dbf2e8f1f60aed4b;hpb=c189ccac5702322ed843fe17057035b7222a59b6;p=kvmfornfv.git diff --git a/kernel/tools/perf/util/trace-event-scripting.c b/kernel/tools/perf/util/trace-event-scripting.c index 9df61059a..a2fd6e79d 100644 --- a/kernel/tools/perf/util/trace-event-scripting.c +++ b/kernel/tools/perf/util/trace-event-scripting.c @@ -95,7 +95,8 @@ static void register_python_scripting(struct scripting_ops *scripting_ops) if (err) die("error registering py script extension"); - scripting_context = malloc(sizeof(struct scripting_context)); + if (scripting_context == NULL) + scripting_context = malloc(sizeof(*scripting_context)); } #ifdef NO_LIBPYTHON @@ -159,7 +160,8 @@ static void register_perl_scripting(struct scripting_ops *scripting_ops) if (err) die("error registering pl script extension"); - scripting_context = malloc(sizeof(struct scripting_context)); + if (scripting_context == NULL) + scripting_context = malloc(sizeof(*scripting_context)); } #ifdef NO_LIBPERL