X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Fust%2Fmulti-lib%2Fmulti-lib-test.c;h=6a91089df27dc0c1281060d0e11a897354237efd;hp=e145aa21aeae49e8310dc498c40e301499b88126;hb=9d16b343fb9e781fc8d8fa3c448a3f382306dd33;hpb=3f7f208a0150d93363cbf7755e890a9839114ab5 diff --git a/tests/regression/ust/multi-lib/multi-lib-test.c b/tests/regression/ust/multi-lib/multi-lib-test.c index e145aa21a..6a91089df 100644 --- a/tests/regression/ust/multi-lib/multi-lib-test.c +++ b/tests/regression/ust/multi-lib/multi-lib-test.c @@ -1,18 +1,8 @@ /* - * Copyright (C) - 2018 Francis Deslauriers + * Copyright (C) 2018 Francis Deslauriers * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; version 2.1 of the License. + * SPDX-License-Identifier: LGPL-2.1-only * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -201,12 +191,15 @@ int main(int argc, const char **argv) * Populate the libraries array with the arguments passed to the process. */ while (poptPeekArg(optCon) != NULL) { + char **realloced_libraries = NULL; + nb_libraries++; - libraries = realloc(libraries, nb_libraries * sizeof(char *)); - if (!libraries) { + realloced_libraries = realloc(libraries, nb_libraries * sizeof(char *)); + if (!realloced_libraries) { ret = -1; goto error; } + libraries = realloced_libraries; libraries[nb_libraries - 1] = (char *) poptGetArg(optCon); }