Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c: scope_hint: In function ‘dbm_dist_1d_new’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:57:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘malloc((long unsigned int)*dist.nlocals * 4)’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:11: included_from: Included from here.
#   55|     for (int i = 0; i < length; i++) {
#   56|       if (coords[i] == dist->my_rank) {
#   57|->       dist->local_indicies[j++] = i;
#   58|       }
#   59|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:108: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dist
#  106|     assert(omp_get_num_threads() == 1);
#  107|     dbm_distribution_t *dist = calloc(1, sizeof(dbm_distribution_t));
#  108|->   dist->ref_count = 1;
#  109|   
#  110|     dist->comm = cp_mpi_comm_f2c(fortran_comm);

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c: scope_hint: In function ‘dbm_distribution_new’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:108:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘dist’
#  106|     assert(omp_get_num_threads() == 1);
#  107|     dbm_distribution_t *dist = calloc(1, sizeof(dbm_distribution_t));
#  108|->   dist->ref_count = 1;
#  109|   
#  110|     dist->comm = cp_mpi_comm_f2c(fortran_comm);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:110: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dist
#  108|     dist->ref_count = 1;
#  109|   
#  110|->   dist->comm = cp_mpi_comm_f2c(fortran_comm);
#  111|     dist->my_rank = cp_mpi_comm_rank(dist->comm);
#  112|     dist->nranks = cp_mpi_comm_size(dist->comm);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:111: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dist
#  109|   
#  110|     dist->comm = cp_mpi_comm_f2c(fortran_comm);
#  111|->   dist->my_rank = cp_mpi_comm_rank(dist->comm);
#  112|     dist->nranks = cp_mpi_comm_size(dist->comm);
#  113|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:112: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dist
#  110|     dist->comm = cp_mpi_comm_f2c(fortran_comm);
#  111|     dist->my_rank = cp_mpi_comm_rank(dist->comm);
#  112|->   dist->nranks = cp_mpi_comm_size(dist->comm);
#  113|   
#  114|     const int row_dim_remains[2] = {1, 0};

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:115: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dist
#  113|   
#  114|     const int row_dim_remains[2] = {1, 0};
#  115|->   const cp_mpi_comm_t row_comm = cp_mpi_cart_sub(dist->comm, row_dim_remains);
#  116|   
#  117|     const int col_dim_remains[2] = {0, 1};

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_distribution.c:118: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: dist
#  116|   
#  117|     const int col_dim_remains[2] = {0, 1};
#  118|->   const cp_mpi_comm_t col_comm = cp_mpi_cart_sub(dist->comm, col_dim_remains);
#  119|   
#  120|     const int nshards = DBM_SHARDS_PER_THREAD * omp_get_max_threads();

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:32: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   30|     assert(dist->cols.length == ncols);
#   31|     dbm_distribution_hold(dist);
#   32|->   matrix->dist = dist;
#   33|   
#   34|     size_t size = (strlen(name) + 1) * sizeof(char);

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c: scope_hint: In function ‘dbm_create’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:32:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘matrix’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:10: included_from: Included from here.
#   30|     assert(dist->cols.length == ncols);
#   31|     dbm_distribution_hold(dist);
#   32|->   matrix->dist = dist;
#   33|   
#   34|     size_t size = (strlen(name) + 1) * sizeof(char);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:35: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   33|   
#   34|     size_t size = (strlen(name) + 1) * sizeof(char);
#   35|->   matrix->name = malloc(size);
#   36|     assert(matrix->name != NULL && name != NULL);
#   37|     memcpy(matrix->name, name, size);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:36: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   34|     size_t size = (strlen(name) + 1) * sizeof(char);
#   35|     matrix->name = malloc(size);
#   36|->   assert(matrix->name != NULL && name != NULL);
#   37|     memcpy(matrix->name, name, size);
#   38|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:37: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   35|     matrix->name = malloc(size);
#   36|     assert(matrix->name != NULL && name != NULL);
#   37|->   memcpy(matrix->name, name, size);
#   38|   
#   39|     matrix->nrows = nrows;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:39: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   37|     memcpy(matrix->name, name, size);
#   38|   
#   39|->   matrix->nrows = nrows;
#   40|     matrix->ncols = ncols;
#   41|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:40: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   38|   
#   39|     matrix->nrows = nrows;
#   40|->   matrix->ncols = ncols;
#   41|   
#   42|     size = nrows * sizeof(int);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:43: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   41|   
#   42|     size = nrows * sizeof(int);
#   43|->   matrix->row_sizes = malloc(size);
#   44|     assert(matrix->row_sizes != NULL || size == 0);
#   45|     if (size != 0) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:44: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   42|     size = nrows * sizeof(int);
#   43|     matrix->row_sizes = malloc(size);
#   44|->   assert(matrix->row_sizes != NULL || size == 0);
#   45|     if (size != 0) {
#   46|       memcpy(matrix->row_sizes, row_sizes, size);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:50: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   48|   
#   49|     size = ncols * sizeof(int);
#   50|->   matrix->col_sizes = malloc(size);
#   51|     assert(matrix->col_sizes != NULL || size == 0);
#   52|     if (size != 0) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:51: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   49|     size = ncols * sizeof(int);
#   50|     matrix->col_sizes = malloc(size);
#   51|->   assert(matrix->col_sizes != NULL || size == 0);
#   52|     if (size != 0) {
#   53|       memcpy(matrix->col_sizes, col_sizes, size);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:57: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   55|   
#   56|     const int num_shards = dbm_get_num_shards(matrix);
#   57|->   matrix->shards = malloc(num_shards * sizeof(dbm_shard_t));
#   58|     assert(matrix->shards != NULL || num_shards == 0);
#   59|   #pragma omp parallel for

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:58: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#   56|     const int num_shards = dbm_get_num_shards(matrix);
#   57|     matrix->shards = malloc(num_shards * sizeof(dbm_shard_t));
#   58|->   assert(matrix->shards != NULL || num_shards == 0);
#   59|   #pragma omp parallel for
#   60|     for (int ishard = 0; ishard < num_shards; ishard++) {

Error: GCC_ANALYZER_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c: scope_hint: In function ‘dbm_redistribute’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.c:164:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘__builtin_alloca_with_align((sizetype)(cp_mpi_comm_size(comm) + 1) * 4, 32)’
#  162|     // 2nd pass: Fill send_data.
#  163|     int send_data_positions[nranks];
#  164|->   memcpy(send_data_positions, send_displ, nranks * sizeof(int));
#  165|     for (int ishard = 0; ishard < dbm_get_num_shards(matrix); ishard++) {
#  166|       dbm_shard_t *shard = &matrix->shards[ishard];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_matrix.h:238: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: matrix
#  236|    ******************************************************************************/
#  237|   static inline int dbm_get_num_shards(const dbm_matrix_t *matrix) {
#  238|->   return matrix->dist->rows.nshards * matrix->dist->cols.nshards;
#  239|   }
#  240|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_miniapp.c: scope_hint: In function ‘reserve_all_blocks._omp_fn.0’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_miniapp.c:150:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘reserve_row’
#  148|           if (dbm_get_stored_coordinates(matrix, row, col) ==
#  149|               matrix->dist->my_rank) {
#  150|->           reserve_row[iblock] = row;
#  151|             reserve_col[iblock] = col;
#  152|             ++iblock;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply.c:45: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nblocks_per_row
#   43|           const int row = (trans) ? blk->col : blk->row;
#   44|   #pragma omp atomic
#   45|->         ++nblocks_per_row[row];
#   46|         }
#   47|       }

Error: COMPILER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply.c: scope_hint: In function ‘compute_rows_max_eps’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply.c:48:9: warning[-Wdeprecated-openmp]: ‘master’ construct deprecated since OpenMP 5.1, use ‘masked’
#   46|         }
#   47|       }
#   48|-> #pragma omp master
#   49|       cp_mpi_sum_int(nblocks_per_row, nrows, matrix->dist->comm);
#   50|   #pragma omp barrier

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply.c:54: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: nblocks_per_row
#   52|       for (int i = 0; i < nrows; i++) {
#   53|         const float f =
#   54|->           ((float)filter_eps) / ((float)imax(1, nblocks_per_row[i]));
#   55|         row_max_eps[i] = f * f;
#   56|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply.c:55: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: row_max_eps
#   53|         const float f =
#   54|             ((float)filter_eps) / ((float)imax(1, nblocks_per_row[i]));
#   55|->       row_max_eps[i] = f * f;
#   56|       }
#   57|     } // end of omp parallel region

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply.c:81: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#   79|     backend_context_t *const ctx = calloc(1, sizeof(backend_context_t));
#   80|     // BLAS and LIBXSMM benefit in general from DBM_MULTIPLY_TASK_REORDER.
#   81|->   ctx->cpu_options = DBM_MULTIPLY_TASK_REORDER;
#   82|   
#   83|   #if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_DBM)

Error: COMPILER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c: scope_hint: In function ‘fill_send_buffers’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:201:9: warning[-Wdeprecated-openmp]: ‘master’ construct deprecated since OpenMP 5.1, use ‘masked’
#  199|   
#  200|       // Compute send displacements.
#  201|-> #pragma omp master
#  202|       {
#  203|         icumsum(nranks, blks_send_count, blks_send_displ);

Error: COMPILER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c: scope_hint: In function ‘postprocess_received_blocks’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:311:9: warning[-Wdeprecated-openmp]: ‘master’ construct deprecated since OpenMP 5.1, use ‘masked’
#  309|       }
#  310|   #pragma omp barrier
#  311|-> #pragma omp master
#  312|       icumsum(nshards, nblocks_per_shard, shard_start);
#  313|   #pragma omp barrier

Error: CPPCHECK_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:407: warning[uninitvar]: Uninitialized variable: blks_send_count_byte
#  405|         blks_recv_displ_byte[i] = blks_recv_displ[i] * sizeof(dbm_pack_block_t);
#  406|       }
#  407|->     cp_mpi_alltoallv_byte(blks_send, blks_send_count_byte, blks_send_displ_byte,
#  408|                             blks_recv, blks_recv_count_byte, blks_recv_displ_byte,
#  409|                             dist->comm);

Error: CPPCHECK_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:407: warning[uninitvar]: Uninitialized variable: blks_send_displ_byte
#  405|         blks_recv_displ_byte[i] = blks_recv_displ[i] * sizeof(dbm_pack_block_t);
#  406|       }
#  407|->     cp_mpi_alltoallv_byte(blks_send, blks_send_count_byte, blks_send_displ_byte,
#  408|                             blks_recv, blks_recv_count_byte, blks_recv_displ_byte,
#  409|                             dist->comm);

Error: CPPCHECK_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:408: warning[uninitvar]: Uninitialized variable: blks_recv_count_byte
#  406|       }
#  407|       cp_mpi_alltoallv_byte(blks_send, blks_send_count_byte, blks_send_displ_byte,
#  408|->                           blks_recv, blks_recv_count_byte, blks_recv_displ_byte,
#  409|                             dist->comm);
#  410|   

Error: CPPCHECK_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:408: warning[uninitvar]: Uninitialized variable: blks_recv_displ_byte
#  406|       }
#  407|       cp_mpi_alltoallv_byte(blks_send, blks_send_count_byte, blks_send_displ_byte,
#  408|->                           blks_recv, blks_recv_count_byte, blks_recv_displ_byte,
#  409|                             dist->comm);
#  410|   

Error: GCC_ANALYZER_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c: scope_hint: In function ‘pack_matrix’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:463:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘packed.recv_pack.nblocks’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_multiply_comm.c:11: included_from: Included from here.
#  461|   #endif
#  462|   
#  463|->   return packed; // Ownership of packed transfers to caller.
#  464|   }
#  465|   

Error: GCC_ANALYZER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_shard.c: scope_hint: In function ‘dbm_shard_promise_new_block’
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_shard.c:207:9: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_shard.c:11: included_from: Included from here.
cp2k-0.0.0-build/cp2k-0.0.0/src/dbm/dbm_shard.c:207:9: note: only use operands of an integer type inside the size argument
#  205|       assert((shard->nblocks + 1) <= shard->nblocks_allocated);
#  206|       shard->blocks =
#  207|->         realloc(shard->blocks, shard->nblocks_allocated * sizeof(dbm_block_t));
#  208|       assert(shard->blocks != NULL);
#  209|   

Error: GCC_ANALYZER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/common/grid_sphere_cache.c: scope_hint: In function ‘rebuild_cache_entry’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/common/grid_sphere_cache.c:73:20: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/common/grid_sphere_cache.c:73:20: note: only use operands of an integer type inside the size argument
#   71|   
#   72|     // Compute required storage size.
#   73|->   entry->offsets = malloc(max_imr * sizeof(int));
#   74|     assert(entry->offsets != NULL || max_imr == 0);
#   75|     int nbounds_total = 0;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:49: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   47|     const int D = DBL_DECIMAL_DIG;
#   48|     FILE *fp = fopen(filename, "w+");
#   49|->   fprintf(fp, "#Grid task v10\n");
#   50|     fprintf(fp, "orthorhombic %i\n", orthorhombic);
#   51|     fprintf(fp, "border_mask %i\n", border_mask);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:50: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   48|     FILE *fp = fopen(filename, "w+");
#   49|     fprintf(fp, "#Grid task v10\n");
#   50|->   fprintf(fp, "orthorhombic %i\n", orthorhombic);
#   51|     fprintf(fp, "border_mask %i\n", border_mask);
#   52|     fprintf(fp, "func %i\n", func);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:51: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   49|     fprintf(fp, "#Grid task v10\n");
#   50|     fprintf(fp, "orthorhombic %i\n", orthorhombic);
#   51|->   fprintf(fp, "border_mask %i\n", border_mask);
#   52|     fprintf(fp, "func %i\n", func);
#   53|     fprintf(fp, "la_max %i\n", la_max);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:52: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   50|     fprintf(fp, "orthorhombic %i\n", orthorhombic);
#   51|     fprintf(fp, "border_mask %i\n", border_mask);
#   52|->   fprintf(fp, "func %i\n", func);
#   53|     fprintf(fp, "la_max %i\n", la_max);
#   54|     fprintf(fp, "la_min %i\n", la_min);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:53: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   51|     fprintf(fp, "border_mask %i\n", border_mask);
#   52|     fprintf(fp, "func %i\n", func);
#   53|->   fprintf(fp, "la_max %i\n", la_max);
#   54|     fprintf(fp, "la_min %i\n", la_min);
#   55|     fprintf(fp, "lb_max %i\n", lb_max);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:54: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   52|     fprintf(fp, "func %i\n", func);
#   53|     fprintf(fp, "la_max %i\n", la_max);
#   54|->   fprintf(fp, "la_min %i\n", la_min);
#   55|     fprintf(fp, "lb_max %i\n", lb_max);
#   56|     fprintf(fp, "lb_min %i\n", lb_min);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:55: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   53|     fprintf(fp, "la_max %i\n", la_max);
#   54|     fprintf(fp, "la_min %i\n", la_min);
#   55|->   fprintf(fp, "lb_max %i\n", lb_max);
#   56|     fprintf(fp, "lb_min %i\n", lb_min);
#   57|     fprintf(fp, "zeta %.*e\n", D, zeta);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:56: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   54|     fprintf(fp, "la_min %i\n", la_min);
#   55|     fprintf(fp, "lb_max %i\n", lb_max);
#   56|->   fprintf(fp, "lb_min %i\n", lb_min);
#   57|     fprintf(fp, "zeta %.*e\n", D, zeta);
#   58|     fprintf(fp, "zetb %.*e\n", D, zetb);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:57: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   55|     fprintf(fp, "lb_max %i\n", lb_max);
#   56|     fprintf(fp, "lb_min %i\n", lb_min);
#   57|->   fprintf(fp, "zeta %.*e\n", D, zeta);
#   58|     fprintf(fp, "zetb %.*e\n", D, zetb);
#   59|     fprintf(fp, "rscale %.*e\n", D, rscale);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:58: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   56|     fprintf(fp, "lb_min %i\n", lb_min);
#   57|     fprintf(fp, "zeta %.*e\n", D, zeta);
#   58|->   fprintf(fp, "zetb %.*e\n", D, zetb);
#   59|     fprintf(fp, "rscale %.*e\n", D, rscale);
#   60|     for (int i = 0; i < 3; i++)

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:59: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   57|     fprintf(fp, "zeta %.*e\n", D, zeta);
#   58|     fprintf(fp, "zetb %.*e\n", D, zetb);
#   59|->   fprintf(fp, "rscale %.*e\n", D, rscale);
#   60|     for (int i = 0; i < 3; i++)
#   61|       fprintf(fp, "dh %i %.*e %.*e %.*e\n", i, D, dh[i][0], D, dh[i][1], D,

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:61: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   59|     fprintf(fp, "rscale %.*e\n", D, rscale);
#   60|     for (int i = 0; i < 3; i++)
#   61|->     fprintf(fp, "dh %i %.*e %.*e %.*e\n", i, D, dh[i][0], D, dh[i][1], D,
#   62|               dh[i][2]);
#   63|     for (int i = 0; i < 3; i++)

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:64: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   62|               dh[i][2]);
#   63|     for (int i = 0; i < 3; i++)
#   64|->     fprintf(fp, "dh_inv %i %.*e %.*e %.*e\n", i, D, dh_inv[i][0], D,
#   65|               dh_inv[i][1], D, dh_inv[i][2]);
#   66|     fprintf(fp, "ra %.*e %.*e %.*e\n", D, ra[0], D, ra[1], D, ra[2]);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:66: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   64|       fprintf(fp, "dh_inv %i %.*e %.*e %.*e\n", i, D, dh_inv[i][0], D,
#   65|               dh_inv[i][1], D, dh_inv[i][2]);
#   66|->   fprintf(fp, "ra %.*e %.*e %.*e\n", D, ra[0], D, ra[1], D, ra[2]);
#   67|     fprintf(fp, "rab %.*e %.*e %.*e\n", D, rab[0], D, rab[1], D, rab[2]);
#   68|     fprintf(fp, "npts_global %i %i %i\n", npts_global[0], npts_global[1],

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:67: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   65|               dh_inv[i][1], D, dh_inv[i][2]);
#   66|     fprintf(fp, "ra %.*e %.*e %.*e\n", D, ra[0], D, ra[1], D, ra[2]);
#   67|->   fprintf(fp, "rab %.*e %.*e %.*e\n", D, rab[0], D, rab[1], D, rab[2]);
#   68|     fprintf(fp, "npts_global %i %i %i\n", npts_global[0], npts_global[1],
#   69|             npts_global[2]);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:68: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   66|     fprintf(fp, "ra %.*e %.*e %.*e\n", D, ra[0], D, ra[1], D, ra[2]);
#   67|     fprintf(fp, "rab %.*e %.*e %.*e\n", D, rab[0], D, rab[1], D, rab[2]);
#   68|->   fprintf(fp, "npts_global %i %i %i\n", npts_global[0], npts_global[1],
#   69|             npts_global[2]);
#   70|     fprintf(fp, "npts_local %i %i %i\n", npts_local[0], npts_local[1],

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:70: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   68|     fprintf(fp, "npts_global %i %i %i\n", npts_global[0], npts_global[1],
#   69|             npts_global[2]);
#   70|->   fprintf(fp, "npts_local %i %i %i\n", npts_local[0], npts_local[1],
#   71|             npts_local[2]);
#   72|     fprintf(fp, "shift_local %i %i %i\n", shift_local[0], shift_local[1],

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:72: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   70|     fprintf(fp, "npts_local %i %i %i\n", npts_local[0], npts_local[1],
#   71|             npts_local[2]);
#   72|->   fprintf(fp, "shift_local %i %i %i\n", shift_local[0], shift_local[1],
#   73|             shift_local[2]);
#   74|     fprintf(fp, "border_width %i %i %i\n", border_width[0], border_width[1],

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:74: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   72|     fprintf(fp, "shift_local %i %i %i\n", shift_local[0], shift_local[1],
#   73|             shift_local[2]);
#   74|->   fprintf(fp, "border_width %i %i %i\n", border_width[0], border_width[1],
#   75|             border_width[2]);
#   76|     fprintf(fp, "radius %.*e\n", D, radius);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:76: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   74|     fprintf(fp, "border_width %i %i %i\n", border_width[0], border_width[1],
#   75|             border_width[2]);
#   76|->   fprintf(fp, "radius %.*e\n", D, radius);
#   77|     fprintf(fp, "o1 %i\n", o1);
#   78|     fprintf(fp, "o2 %i\n", o2);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:77: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   75|             border_width[2]);
#   76|     fprintf(fp, "radius %.*e\n", D, radius);
#   77|->   fprintf(fp, "o1 %i\n", o1);
#   78|     fprintf(fp, "o2 %i\n", o2);
#   79|     fprintf(fp, "n1 %i\n", n1);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:78: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   76|     fprintf(fp, "radius %.*e\n", D, radius);
#   77|     fprintf(fp, "o1 %i\n", o1);
#   78|->   fprintf(fp, "o2 %i\n", o2);
#   79|     fprintf(fp, "n1 %i\n", n1);
#   80|     fprintf(fp, "n2 %i\n", n2);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:79: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   77|     fprintf(fp, "o1 %i\n", o1);
#   78|     fprintf(fp, "o2 %i\n", o2);
#   79|->   fprintf(fp, "n1 %i\n", n1);
#   80|     fprintf(fp, "n2 %i\n", n2);
#   81|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:80: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   78|     fprintf(fp, "o2 %i\n", o2);
#   79|     fprintf(fp, "n1 %i\n", n1);
#   80|->   fprintf(fp, "n2 %i\n", n2);
#   81|   
#   82|     for (int i = 0; i < n2; i++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/cpu/grid_cpu_collocate.c:84: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#   82|     for (int i = 0; i < n2; i++) {
#   83|       for (int j = 0; j < n1; j++) {
#   84|->       fprintf(fp, "pab %i %i %.*e\n", i, j, D, pab[i][j]);
#   85|       }
#   86|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:157: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  155|   void update_basis_set(const int nkinds, const grid_basis_set **const basis_sets,
#  156|                         grid_context *data) {
#  157|->   if (nkinds > data->nkinds_total) {
#  158|       if (data->basis_sets == NULL) {
#  159|         data->basis_sets = malloc(nkinds * sizeof(grid_basis_set *));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:165: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  163|       }
#  164|     }
#  165|->   assert(data->basis_sets != NULL);
#  166|     data->nkinds = nkinds;
#  167|     data->nkinds_total = imax(data->nkinds_total, nkinds);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:166: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  164|     }
#  165|     assert(data->basis_sets != NULL);
#  166|->   data->nkinds = nkinds;
#  167|     data->nkinds_total = imax(data->nkinds_total, nkinds);
#  168|     memcpy(data->basis_sets, basis_sets, nkinds * sizeof(grid_basis_set *));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:167: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  165|     assert(data->basis_sets != NULL);
#  166|     data->nkinds = nkinds;
#  167|->   data->nkinds_total = imax(data->nkinds_total, nkinds);
#  168|     memcpy(data->basis_sets, basis_sets, nkinds * sizeof(grid_basis_set *));
#  169|   }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:168: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  166|     data->nkinds = nkinds;
#  167|     data->nkinds_total = imax(data->nkinds_total, nkinds);
#  168|->   memcpy(data->basis_sets, basis_sets, nkinds * sizeof(grid_basis_set *));
#  169|   }
#  170|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:181: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  179|                          const double rab_list[ntasks][3], grid_context *ctx) {
#  180|   
#  181|->   assert(ctx->checksum == ctx_checksum);
#  182|   
#  183|     if (nlevels == 0)

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:186: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  184|       return;
#  185|   
#  186|->   if (ctx->ntasks == 0) {
#  187|       // Count tasks per level.
#  188|       size_t size = nlevels * sizeof(int);

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c: scope_hint: In function ‘update_task_lists.part.0’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:193:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*ctx.tasks’
#  191|       /* memset(ctx->tasks, 0, nlevels * sizeof(_task *)); */
#  192|       if (ntasks)
#  193|->       ctx->tasks[0] = malloc(ntasks * sizeof(_task));
#  194|       else
#  195|         ctx->tasks[0] = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:193:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)nlevels * 8)’
/usr/include/libxsmm_macros.h:819: included_from: Included from here.
/usr/include/libxsmm_typedefs.h:14: included_from: Included from here.
/usr/include/libxsmm_dnn.h:14: included_from: Included from here.
/usr/include/libxsmm_dnn_convolution.h:14: included_from: Included from here.
/usr/include/libxsmm.h:44: included_from: Included from here.
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_utils.h:21: included_from: Included from here.
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:21: included_from: Included from here.
#  191|       /* memset(ctx->tasks, 0, nlevels * sizeof(_task *)); */
#  192|       if (ntasks)
#  193|->       ctx->tasks[0] = malloc(ntasks * sizeof(_task));
#  194|       else
#  195|         ctx->tasks[0] = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:195:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*ctx.tasks’
#  193|         ctx->tasks[0] = malloc(ntasks * sizeof(_task));
#  194|       else
#  195|->       ctx->tasks[0] = NULL;
#  196|     } else {
#  197|       if (ctx->nlevels_total < nlevels) {

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:195:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)nlevels * 8)’
#  193|         ctx->tasks[0] = malloc(ntasks * sizeof(_task));
#  194|       else
#  195|->       ctx->tasks[0] = NULL;
#  196|     } else {
#  197|       if (ctx->nlevels_total < nlevels) {

Error: GCC_ANALYZER_WARNING (CWE-688):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:208:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ctx.tasks_per_level’ where non-null expected
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:12: included_from: Included from here.
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  206|     }
#  207|   
#  208|->   memset(ctx->tasks_per_level, 0, nlevels * sizeof(int));
#  209|     ctx->nlevels = nlevels;
#  210|     ctx->nlevels_total = imax(ctx->nlevels_total, nlevels);

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:235:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘task’
#  233|         prev_jset = -1;
#  234|       }
#  235|->     task->level = level_list[i] - 1;
#  236|       task->iatom = iatom_list[i] - 1;
#  237|       task->jatom = jatom_list[i] - 1;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:376: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  374|     grid_context *ctx = malloc(sizeof(grid_context));
#  375|   
#  376|->   memset(ctx, 0, sizeof(grid_context));
#  377|   
#  378|     ctx->checksum = ctx_checksum;

Error: GCC_ANALYZER_WARNING (CWE-688):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c: scope_hint: In function ‘create_grid_context_dgemm’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:376:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ctx’ where non-null expected
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  374|     grid_context *ctx = malloc(sizeof(grid_context));
#  375|   
#  376|->   memset(ctx, 0, sizeof(grid_context));
#  377|   
#  378|     ctx->checksum = ctx_checksum;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:378: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  376|     memset(ctx, 0, sizeof(grid_context));
#  377|   
#  378|->   ctx->checksum = ctx_checksum;
#  379|     ctx->orthorhombic = orthorhombic;
#  380|     update_block_offsets(nblocks, block_offsets, ctx);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:379: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  377|   
#  378|     ctx->checksum = ctx_checksum;
#  379|->   ctx->orthorhombic = orthorhombic;
#  380|     update_block_offsets(nblocks, block_offsets, ctx);
#  381|     update_atoms_position(natoms, atom_positions, ctx);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:394: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  392|     const int max_threads = omp_get_max_threads();
#  393|   
#  394|->   ctx->handler =
#  395|         malloc(sizeof(struct collocation_integration_ *) * max_threads);
#  396|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:398: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  396|   
#  397|     for (int i = 0; i < max_threads; i++) {
#  398|->     ctx->handler[i] = collocate_create_handle();
#  399|     }
#  400|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:398:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*ctx.handler + (long unsigned int)i * 8’
#  396|   
#  397|     for (int i = 0; i < max_threads; i++) {
#  398|->     ctx->handler[i] = collocate_create_handle();
#  399|     }
#  400|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:398:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc((long unsigned int)max_threads * 8)’
#  396|   
#  397|     for (int i = 0; i < max_threads; i++) {
#  398|->     ctx->handler[i] = collocate_create_handle();
#  399|     }
#  400|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/dgemm/grid_dgemm_context.c:401: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ctx
#  399|     }
#  400|   
#  401|->   ctx->number_of_handler = max_threads;
#  402|   
#  403|     return ctx;

Error: GCC_ANALYZER_WARNING (CWE-775):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:32:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
#   30|    ******************************************************************************/
#   31|   static void read_next_line(char line[], int length, FILE *fp) {
#   32|->   if (fgets(line, length, fp) == NULL) {
#   33|       fprintf(stderr, "Error: Could not read line.\n");
#   34|       abort();

Error: GCC_ANALYZER_WARNING (CWE-401):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:32:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
#   30|    ******************************************************************************/
#   31|   static void read_next_line(char line[], int length, FILE *fp) {
#   32|->   if (fgets(line, length, fp) == NULL) {
#   33|       fprintf(stderr, "Error: Could not read line.\n");
#   34|       abort();

Error: GCC_ANALYZER_WARNING (CWE-775):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:50:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
#   48|       assert(!"parse_int failed");
#   49|     }
#   50|->   return value;
#   51|   }
#   52|   

Error: GCC_ANALYZER_WARNING (CWE-401):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:50:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
#   48|       assert(!"parse_int failed");
#   49|     }
#   50|->   return value;
#   51|   }
#   52|   

Error: GCC_ANALYZER_WARNING (CWE-775):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:243:6: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
#  241|     char header_line[100];
#  242|     read_next_line(header_line, sizeof(header_line), fp);
#  243|->   if (strcmp(header_line, "#Grid task v10\n") != 0) {
#  244|       fprintf(stderr, "Error: Wrong file header.\n");
#  245|       abort();

Error: GCC_ANALYZER_WARNING (CWE-401):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:243:6: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
#  241|     char header_line[100];
#  242|     read_next_line(header_line, sizeof(header_line), fp);
#  243|->   if (strcmp(header_line, "#Grid task v10\n") != 0) {
#  244|       fprintf(stderr, "Error: Wrong file header.\n");
#  245|       abort();

Error: GCC_ANALYZER_WARNING (CWE-457):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:448:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*hab_test[i][j]’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c: scope_hint: In function ‘grid_replay’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_replay.c:8: included_from: Included from here.
#  446|         for (int j = 0; j < n1; j++) {
#  447|           const double ref_value = cycles * hab_ref[i][j];
#  448|->         const double test_value = hab_test[i][j];
#  449|           const double diff = fabs(test_value - ref_value);
#  450|           const double rel_diff = diff / fmax(1.0, fabs(ref_value));

Error: GCC_ANALYZER_WARNING (CWE-131):
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_task_list.c: scope_hint: In function ‘grid_create_task_list’
cp2k-0.0.0-build/cp2k-0.0.0/src/grid/grid_task_list.c:71:25: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#   69|     task_list->nlevels = nlevels;
#   70|     size_t size = nlevels * 3 * sizeof(int);
#   71|->   task_list->npts_local = malloc(size);
#   72|     assert(task_list->npts_local != NULL);
#   73|     memcpy(task_list->npts_local, npts_local, size);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:80: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#   78|   
#   79|     for (int i = 0; i < *rpp_num_primitives; i++) {
#   80|->     pot_powers_int[i] = rpp_powers[i];
#   81|     }
#   82|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_type1_integrals_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:80:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#   78|   
#   79|     for (int i = 0; i < *rpp_num_primitives; i++) {
#   80|->     pot_powers_int[i] = rpp_powers[i];
#   81|     }
#   82|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:116: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#  114|   
#  115|     for (int i = 0; i < *pot_num_primitives; i++) {
#  116|->     pot_powers_int[i] = pot_powers[i];
#  117|     }
#  118|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_type2_integrals_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:116:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#  114|   
#  115|     for (int i = 0; i < *pot_num_primitives; i++) {
#  116|->     pot_powers_int[i] = pot_powers[i];
#  117|     }
#  118|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:154: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#  152|   
#  153|     for (int i = 0; i < *pot_num_primitives; i++) {
#  154|->     pot_powers_int[i] = pot_powers[i];
#  155|     }
#  156|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_spin_orbit_integrals_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:154:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#  152|   
#  153|     for (int i = 0; i < *pot_num_primitives; i++) {
#  154|->     pot_powers_int[i] = pot_powers[i];
#  155|     }
#  156|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:214: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#  212|     int *pot_powers_int = (int *)calloc(*pot_num_primitives, sizeof(int));
#  213|     for (int i = 0; i < *pot_num_primitives; i++) {
#  214|->     pot_powers_int[i] = pot_powers[i];
#  215|     }
#  216|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_outercore_potential_integrals_part_1_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:214:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#  212|     int *pot_powers_int = (int *)calloc(*pot_num_primitives, sizeof(int));
#  213|     for (int i = 0; i < *pot_num_primitives; i++) {
#  214|->     pot_powers_int[i] = pot_powers[i];
#  215|     }
#  216|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:299: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot1_powers_int
#  297|   
#  298|     for (int i = 0; i < *pot1_num_primitives; i++) {
#  299|->     pot1_powers_int[i] = pot1_powers[i];
#  300|     }
#  301|     for (int i = 0; i < *pot2_num_primitives; i++) {

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_outercore_potential_integrals_part_2_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:299:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot1_powers_int’
#  297|   
#  298|     for (int i = 0; i < *pot1_num_primitives; i++) {
#  299|->     pot1_powers_int[i] = pot1_powers[i];
#  300|     }
#  301|     for (int i = 0; i < *pot2_num_primitives; i++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:302: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot2_powers_int
#  300|     }
#  301|     for (int i = 0; i < *pot2_num_primitives; i++) {
#  302|->     pot2_powers_int[i] = pot2_powers[i];
#  303|     }
#  304|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:302:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot2_powers_int’
#  300|     }
#  301|     for (int i = 0; i < *pot2_num_primitives; i++) {
#  302|->     pot2_powers_int[i] = pot2_powers[i];
#  303|     }
#  304|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:380: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#  378|   
#  379|     for (int i = 0; i < *rpp_num_primitives; i++) {
#  380|->     pot_powers_int[i] = rpp_powers[i];
#  381|     }
#  382|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_type1_integrals_gradient_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:380:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#  378|   
#  379|     for (int i = 0; i < *rpp_num_primitives; i++) {
#  380|->     pot_powers_int[i] = rpp_powers[i];
#  381|     }
#  382|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:418: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#  416|     int *pot_powers_int = (int *)calloc(*pot_num_primitives, sizeof(int));
#  417|     for (int i = 0; i < *pot_num_primitives; i++) {
#  418|->     pot_powers_int[i] = pot_powers[i];
#  419|     }
#  420|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_type2_integrals_gradient_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:418:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#  416|     int *pot_powers_int = (int *)calloc(*pot_num_primitives, sizeof(int));
#  417|     for (int i = 0; i < *pot_num_primitives; i++) {
#  418|->     pot_powers_int[i] = pot_powers[i];
#  419|     }
#  420|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:484: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot_powers_int
#  482|   
#  483|     for (int i = 0; i < *pot_num_primitives; i++) {
#  484|->     pot_powers_int[i] = pot_powers[i];
#  485|     }
#  486|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c: scope_hint: In function ‘libgrpp_spin_orbit_integrals_gradient_’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_fortran.c:484:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot_powers_int’
#  482|   
#  483|     for (int i = 0; i < *pot_num_primitives; i++) {
#  484|->     pot_powers_int[i] = pot_powers[i];
#  485|     }
#  486|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_integrals_gradient.c:903: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grad
#  901|     double **grad = (double **)calloc(3, sizeof(double *));
#  902|     for (int icoord = 0; icoord < 3; icoord++) {
#  903|->     grad[icoord] = (double *)calloc(size, sizeof(double));
#  904|     }
#  905|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_integrals_gradient.c: scope_hint: In function ‘libgrpp_alloc_gradients’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_integrals_gradient.c:903:18: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘grad’
#  901|     double **grad = (double **)calloc(3, sizeof(double *));
#  902|     for (int icoord = 0; icoord < 3; icoord++) {
#  903|->     grad[icoord] = (double *)calloc(size, sizeof(double));
#  904|     }
#  905|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:66: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lx_matrix_csh
#   64|   
#   65|         double complex lx = 0.0 + 0.0 * I;
#   66|->       lx += conj(a1) * a2 * lx_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   67|         lx += conj(a1) * b2 * lx_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   68|         lx += conj(b1) * a2 * lx_matrix_csh[dim * (m1p + L) + (m2m + L)];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:67: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lx_matrix_csh
#   65|         double complex lx = 0.0 + 0.0 * I;
#   66|         lx += conj(a1) * a2 * lx_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   67|->       lx += conj(a1) * b2 * lx_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   68|         lx += conj(b1) * a2 * lx_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   69|         lx += conj(b1) * b2 * lx_matrix_csh[dim * (m1p + L) + (m2p + L)];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:68: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lx_matrix_csh
#   66|         lx += conj(a1) * a2 * lx_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   67|         lx += conj(a1) * b2 * lx_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   68|->       lx += conj(b1) * a2 * lx_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   69|         lx += conj(b1) * b2 * lx_matrix_csh[dim * (m1p + L) + (m2p + L)];
#   70|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:69: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lx_matrix_csh
#   67|         lx += conj(a1) * b2 * lx_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   68|         lx += conj(b1) * a2 * lx_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   69|->       lx += conj(b1) * b2 * lx_matrix_csh[dim * (m1p + L) + (m2p + L)];
#   70|   
#   71|         double complex ly = 0.0 + 0.0 * I;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:72: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ly_matrix_csh
#   70|   
#   71|         double complex ly = 0.0 + 0.0 * I;
#   72|->       ly += conj(a1) * a2 * ly_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   73|         ly += conj(a1) * b2 * ly_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   74|         ly += conj(b1) * a2 * ly_matrix_csh[dim * (m1p + L) + (m2m + L)];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:73: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ly_matrix_csh
#   71|         double complex ly = 0.0 + 0.0 * I;
#   72|         ly += conj(a1) * a2 * ly_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   73|->       ly += conj(a1) * b2 * ly_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   74|         ly += conj(b1) * a2 * ly_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   75|         ly += conj(b1) * b2 * ly_matrix_csh[dim * (m1p + L) + (m2p + L)];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:74: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ly_matrix_csh
#   72|         ly += conj(a1) * a2 * ly_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   73|         ly += conj(a1) * b2 * ly_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   74|->       ly += conj(b1) * a2 * ly_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   75|         ly += conj(b1) * b2 * ly_matrix_csh[dim * (m1p + L) + (m2p + L)];
#   76|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:75: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ly_matrix_csh
#   73|         ly += conj(a1) * b2 * ly_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   74|         ly += conj(b1) * a2 * ly_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   75|->       ly += conj(b1) * b2 * ly_matrix_csh[dim * (m1p + L) + (m2p + L)];
#   76|   
#   77|         double complex lz = 0.0 + 0.0 * I;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:78: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lz_matrix_csh
#   76|   
#   77|         double complex lz = 0.0 + 0.0 * I;
#   78|->       lz += conj(a1) * a2 * lz_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   79|         lz += conj(a1) * b2 * lz_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   80|         lz += conj(b1) * a2 * lz_matrix_csh[dim * (m1p + L) + (m2m + L)];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:79: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lz_matrix_csh
#   77|         double complex lz = 0.0 + 0.0 * I;
#   78|         lz += conj(a1) * a2 * lz_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   79|->       lz += conj(a1) * b2 * lz_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   80|         lz += conj(b1) * a2 * lz_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   81|         lz += conj(b1) * b2 * lz_matrix_csh[dim * (m1p + L) + (m2p + L)];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:80: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lz_matrix_csh
#   78|         lz += conj(a1) * a2 * lz_matrix_csh[dim * (m1m + L) + (m2m + L)];
#   79|         lz += conj(a1) * b2 * lz_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   80|->       lz += conj(b1) * a2 * lz_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   81|         lz += conj(b1) * b2 * lz_matrix_csh[dim * (m1p + L) + (m2p + L)];
#   82|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:81: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lz_matrix_csh
#   79|         lz += conj(a1) * b2 * lz_matrix_csh[dim * (m1m + L) + (m2p + L)];
#   80|         lz += conj(b1) * a2 * lz_matrix_csh[dim * (m1p + L) + (m2m + L)];
#   81|->       lz += conj(b1) * b2 * lz_matrix_csh[dim * (m1p + L) + (m2p + L)];
#   82|   
#   83|         lx_matrix[(m1 + L) * dim + (m2 + L)] = cimag(lx);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:105: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lx_matrix
#  103|   
#  104|     // set all matrices to zero
#  105|->   memset(lx_matrix, 0, dim * dim * sizeof(double));
#  106|     memset(ly_matrix, 0, dim * dim * sizeof(double));
#  107|     memset(lz_matrix, 0, dim * dim * sizeof(double));

Error: GCC_ANALYZER_WARNING (CWE-688):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c: scope_hint: In function ‘libgrpp_construct_angular_momentum_matrices_csh’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:105:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘lx_matrix’ where non-null expected
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:25: included_from: Included from here.
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  103|   
#  104|     // set all matrices to zero
#  105|->   memset(lx_matrix, 0, dim * dim * sizeof(double));
#  106|     memset(ly_matrix, 0, dim * dim * sizeof(double));
#  107|     memset(lz_matrix, 0, dim * dim * sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:106: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ly_matrix
#  104|     // set all matrices to zero
#  105|     memset(lx_matrix, 0, dim * dim * sizeof(double));
#  106|->   memset(ly_matrix, 0, dim * dim * sizeof(double));
#  107|     memset(lz_matrix, 0, dim * dim * sizeof(double));
#  108|   

Error: GCC_ANALYZER_WARNING (CWE-688):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:106:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ly_matrix’ where non-null expected
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  104|     // set all matrices to zero
#  105|     memset(lx_matrix, 0, dim * dim * sizeof(double));
#  106|->   memset(ly_matrix, 0, dim * dim * sizeof(double));
#  107|     memset(lz_matrix, 0, dim * dim * sizeof(double));
#  108|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:107: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lz_matrix
#  105|     memset(lx_matrix, 0, dim * dim * sizeof(double));
#  106|     memset(ly_matrix, 0, dim * dim * sizeof(double));
#  107|->   memset(lz_matrix, 0, dim * dim * sizeof(double));
#  108|   
#  109|     for (int m1 = -L; m1 <= L; m1++) {

Error: GCC_ANALYZER_WARNING (CWE-688):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:107:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘lz_matrix’ where non-null expected
/usr/include/string.h:65:14: note: argument 1 of ‘memset’ must be non-null
#  105|     memset(lx_matrix, 0, dim * dim * sizeof(double));
#  106|     memset(ly_matrix, 0, dim * dim * sizeof(double));
#  107|->   memset(lz_matrix, 0, dim * dim * sizeof(double));
#  108|   
#  109|     for (int m1 = -L; m1 <= L; m1++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:118: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lx_matrix
#  116|         double ly = 0.5 * (lp - lm);
#  117|   
#  118|->       lx_matrix[(m1 + L) * dim + (m2 + L)] = lx;
#  119|         ly_matrix[(m1 + L) * dim + (m2 + L)] = ly;
#  120|         lz_matrix[(m1 + L) * dim + (m2 + L)] = lz;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:119: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: ly_matrix
#  117|   
#  118|         lx_matrix[(m1 + L) * dim + (m2 + L)] = lx;
#  119|->       ly_matrix[(m1 + L) * dim + (m2 + L)] = ly;
#  120|         lz_matrix[(m1 + L) * dim + (m2 + L)] = lz;
#  121|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_lmatrix.c:120: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lz_matrix
#  118|         lx_matrix[(m1 + L) * dim + (m2 + L)] = lx;
#  119|         ly_matrix[(m1 + L) * dim + (m2 + L)] = ly;
#  120|->       lz_matrix[(m1 + L) * dim + (m2 + L)] = lz;
#  121|       }
#  122|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c:164: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: S_lm_coef
#  162|         double u = libgrpp_spherical_to_cartesian_coef(L, m, r, s) /
#  163|                    ang_norm_factor(r, s, t);
#  164|->       S_lm_coef[size_nlj * (m + L) + icart] = u;
#  165|       }
#  166|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c:330: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: S_lm_coef
#  328|         double u = libgrpp_spherical_to_cartesian_coef(L, m, r, s) /
#  329|                    ang_norm_factor(r, s, t);
#  330|->       S_lm_coef[size_nlj * (m + L) + icart] = u;
#  331|       }
#  332|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c:514: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: S_lm_coef
#  512|   
#  513|         for (int icart = 0; icart < dim_ket_cart; icart++) {
#  514|->         double u_nljm = S_lm_coef[dim_ket_cart * j + icart];
#  515|           s += u_nljm * A_in[i * dim_ket_cart + icart];
#  516|         }

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c: scope_hint: In function ‘transform_to_sph_basis_ket’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c:514:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘S_lm_coef’
#  512|   
#  513|         for (int icart = 0; icart < dim_ket_cart; icart++) {
#  514|->         double u_nljm = S_lm_coef[dim_ket_cart * j + icart];
#  515|           s += u_nljm * A_in[i * dim_ket_cart + icart];
#  516|         }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c:532: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: S_lm_coef
#  530|   
#  531|         for (int icart = 0; icart < dim_bra_cart; icart++) {
#  532|->         double u_nljm = S_lm_coef[dim_bra_cart * i + icart];
#  533|           s += u_nljm * A_in[icart * dim_ket + j];
#  534|         }

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c: scope_hint: In function ‘transform_to_sph_basis_bra’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_outercore_integrals.c:532:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘S_lm_coef’
#  530|   
#  531|         for (int icart = 0; icart < dim_bra_cart; icart++) {
#  532|->         double u_nljm = S_lm_coef[dim_bra_cart * i + icart];
#  533|           s += u_nljm * A_in[icart * dim_ket + j];
#  534|         }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:38: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   36|         (libgrpp_potential_t *)calloc(1, sizeof(libgrpp_potential_t));
#   37|   
#   38|->   pot->L = L;
#   39|     pot->J = J;
#   40|     pot->powers = (int *)calloc(num_primitives, sizeof(int));

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c: scope_hint: In function ‘libgrpp_new_potential’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:38:10: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘pot’
#   36|         (libgrpp_potential_t *)calloc(1, sizeof(libgrpp_potential_t));
#   37|   
#   38|->   pot->L = L;
#   39|     pot->J = J;
#   40|     pot->powers = (int *)calloc(num_primitives, sizeof(int));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:39: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   37|   
#   38|     pot->L = L;
#   39|->   pot->J = J;
#   40|     pot->powers = (int *)calloc(num_primitives, sizeof(int));
#   41|     pot->coeffs = (double *)calloc(num_primitives, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:40: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   38|     pot->L = L;
#   39|     pot->J = J;
#   40|->   pot->powers = (int *)calloc(num_primitives, sizeof(int));
#   41|     pot->coeffs = (double *)calloc(num_primitives, sizeof(double));
#   42|     pot->alpha = (double *)calloc(num_primitives, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:41: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   39|     pot->J = J;
#   40|     pot->powers = (int *)calloc(num_primitives, sizeof(int));
#   41|->   pot->coeffs = (double *)calloc(num_primitives, sizeof(double));
#   42|     pot->alpha = (double *)calloc(num_primitives, sizeof(double));
#   43|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:42: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   40|     pot->powers = (int *)calloc(num_primitives, sizeof(int));
#   41|     pot->coeffs = (double *)calloc(num_primitives, sizeof(double));
#   42|->   pot->alpha = (double *)calloc(num_primitives, sizeof(double));
#   43|   
#   44|     pot->num_primitives = 0;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:44: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   42|     pot->alpha = (double *)calloc(num_primitives, sizeof(double));
#   43|   
#   44|->   pot->num_primitives = 0;
#   45|     for (int i = 0; i < num_primitives; i++) {
#   46|       if (fabs(coeffs[i]) < LIBGRPP_ZERO_THRESH) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:46: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coeffs
#   44|     pot->num_primitives = 0;
#   45|     for (int i = 0; i < num_primitives; i++) {
#   46|->     if (fabs(coeffs[i]) < LIBGRPP_ZERO_THRESH) {
#   47|         continue;
#   48|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:50: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coeffs
#   48|       }
#   49|   
#   50|->     pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|       pot->powers[pot->num_primitives] = powers[i];
#   52|       pot->alpha[pot->num_primitives] = alpha[i];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:50: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   48|       }
#   49|   
#   50|->     pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|       pot->powers[pot->num_primitives] = powers[i];
#   52|       pot->alpha[pot->num_primitives] = alpha[i];

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:50:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)num_primitives, 8)’
#   48|       }
#   49|   
#   50|->     pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|       pot->powers[pot->num_primitives] = powers[i];
#   52|       pot->alpha[pot->num_primitives] = alpha[i];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:51: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   49|   
#   50|       pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|->     pot->powers[pot->num_primitives] = powers[i];
#   52|       pot->alpha[pot->num_primitives] = alpha[i];
#   53|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:51: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: powers
#   49|   
#   50|       pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|->     pot->powers[pot->num_primitives] = powers[i];
#   52|       pot->alpha[pot->num_primitives] = alpha[i];
#   53|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:51:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)num_primitives, 4)’
#   49|   
#   50|       pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|->     pot->powers[pot->num_primitives] = powers[i];
#   52|       pot->alpha[pot->num_primitives] = alpha[i];
#   53|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:52: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: alpha
#   50|       pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|       pot->powers[pot->num_primitives] = powers[i];
#   52|->     pot->alpha[pot->num_primitives] = alpha[i];
#   53|   
#   54|       pot->num_primitives++;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:52: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   50|       pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|       pot->powers[pot->num_primitives] = powers[i];
#   52|->     pot->alpha[pot->num_primitives] = alpha[i];
#   53|   
#   54|       pot->num_primitives++;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:52:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)num_primitives, 8)’
#   50|       pot->coeffs[pot->num_primitives] = coeffs[i];
#   51|       pot->powers[pot->num_primitives] = powers[i];
#   52|->     pot->alpha[pot->num_primitives] = alpha[i];
#   53|   
#   54|       pot->num_primitives++;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:54: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pot
#   52|       pot->alpha[pot->num_primitives] = alpha[i];
#   53|   
#   54|->     pot->num_primitives++;
#   55|     }
#   56|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c: scope_hint: In function ‘libgrpp_shrink_potential’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:106:40: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_powers’
#  104|     for (int i = 0; i < n; i++) {
#  105|       if (fabs(src_potential->coeffs[i]) > LIBGRPP_ZERO_THRESH) {
#  106|->       new_powers[n_nonzero_primitives] = src_potential->powers[i];
#  107|         new_coeffs[n_nonzero_primitives] = src_potential->coeffs[i];
#  108|         new_alpha[n_nonzero_primitives] = src_potential->alpha[i];

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:107:40: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_coeffs’
#  105|       if (fabs(src_potential->coeffs[i]) > LIBGRPP_ZERO_THRESH) {
#  106|         new_powers[n_nonzero_primitives] = src_potential->powers[i];
#  107|->       new_coeffs[n_nonzero_primitives] = src_potential->coeffs[i];
#  108|         new_alpha[n_nonzero_primitives] = src_potential->alpha[i];
#  109|         n_nonzero_primitives++;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_potential.c:108:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_alpha’
#  106|         new_powers[n_nonzero_primitives] = src_potential->powers[i];
#  107|         new_coeffs[n_nonzero_primitives] = src_potential->coeffs[i];
#  108|->       new_alpha[n_nonzero_primitives] = src_potential->alpha[i];
#  109|         n_nonzero_primitives++;
#  110|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:97: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#   95|   
#   96|     table = (radial_type1_table_t *)calloc(1, sizeof(radial_type1_table_t));
#   97|->   table->lambda_max = lambda_max;
#   98|     table->n_max = n_max;
#   99|     table->radial_integrals =

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c: scope_hint: In function ‘libgrpp_tabulate_radial_type1_integrals’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:97:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘table’
#   95|   
#   96|     table = (radial_type1_table_t *)calloc(1, sizeof(radial_type1_table_t));
#   97|->   table->lambda_max = lambda_max;
#   98|     table->n_max = n_max;
#   99|     table->radial_integrals =

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:98: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#   96|     table = (radial_type1_table_t *)calloc(1, sizeof(radial_type1_table_t));
#   97|     table->lambda_max = lambda_max;
#   98|->   table->n_max = n_max;
#   99|     table->radial_integrals =
#  100|         (double *)calloc((lambda_max + 1) * (n_max + 1), sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:99: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#   97|     table->lambda_max = lambda_max;
#   98|     table->n_max = n_max;
#   99|->   table->radial_integrals =
#  100|         (double *)calloc((lambda_max + 1) * (n_max + 1), sizeof(double));
#  101|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:122: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  120|                                                    &converged);
#  121|   
#  122|->       table->radial_integrals[lambda * (lambda_max + 1) + n] = Q;
#  123|       }
#  124|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:163: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  161|         (radial_type1_grid_t *)calloc(1, sizeof(radial_type1_grid_t));
#  162|   
#  163|->   grid->nr = MIN_GRID;
#  164|     grid->n_max = n_max;
#  165|     grid->lambda_max = lambda_max;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c: scope_hint: In function ‘create_radial_type1_grid’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:163:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘grid’
#  161|         (radial_type1_grid_t *)calloc(1, sizeof(radial_type1_grid_t));
#  162|   
#  163|->   grid->nr = MIN_GRID;
#  164|     grid->n_max = n_max;
#  165|     grid->lambda_max = lambda_max;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:164: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  162|   
#  163|     grid->nr = MIN_GRID;
#  164|->   grid->n_max = n_max;
#  165|     grid->lambda_max = lambda_max;
#  166|     grid->params = params;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:165: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  163|     grid->nr = MIN_GRID;
#  164|     grid->n_max = n_max;
#  165|->   grid->lambda_max = lambda_max;
#  166|     grid->params = params;
#  167|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:166: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  164|     grid->n_max = n_max;
#  165|     grid->lambda_max = lambda_max;
#  166|->   grid->params = params;
#  167|   
#  168|     grid->r = (double *)calloc(MAX_GRID, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:168: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  166|     grid->params = params;
#  167|   
#  168|->   grid->r = (double *)calloc(MAX_GRID, sizeof(double));
#  169|     grid->w = (double *)calloc(MAX_GRID, sizeof(double));
#  170|     grid->pot_values = (double *)calloc(MAX_GRID, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:169: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  167|   
#  168|     grid->r = (double *)calloc(MAX_GRID, sizeof(double));
#  169|->   grid->w = (double *)calloc(MAX_GRID, sizeof(double));
#  170|     grid->pot_values = (double *)calloc(MAX_GRID, sizeof(double));
#  171|     grid->gto_values = (double *)calloc(MAX_GRID, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:170: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  168|     grid->r = (double *)calloc(MAX_GRID, sizeof(double));
#  169|     grid->w = (double *)calloc(MAX_GRID, sizeof(double));
#  170|->   grid->pot_values = (double *)calloc(MAX_GRID, sizeof(double));
#  171|     grid->gto_values = (double *)calloc(MAX_GRID, sizeof(double));
#  172|     grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:171: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  169|     grid->w = (double *)calloc(MAX_GRID, sizeof(double));
#  170|     grid->pot_values = (double *)calloc(MAX_GRID, sizeof(double));
#  171|->   grid->gto_values = (double *)calloc(MAX_GRID, sizeof(double));
#  172|     grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);
#  173|     grid->mod_bessel = alloc_zeros_2d(lambda_max + 1, MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:172: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  170|     grid->pot_values = (double *)calloc(MAX_GRID, sizeof(double));
#  171|     grid->gto_values = (double *)calloc(MAX_GRID, sizeof(double));
#  172|->   grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);
#  173|     grid->mod_bessel = alloc_zeros_2d(lambda_max + 1, MAX_GRID);
#  174|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:173: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  171|     grid->gto_values = (double *)calloc(MAX_GRID, sizeof(double));
#  172|     grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);
#  173|->   grid->mod_bessel = alloc_zeros_2d(lambda_max + 1, MAX_GRID);
#  174|   
#  175|     // initial set of pre-calculated points

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:176: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  174|   
#  175|     // initial set of pre-calculated points
#  176|->   int nr = grid->nr;
#  177|     const double R = 5.0;
#  178|     const double R3 = R * R * R;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:187: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  185|       double ri = -R * ln_xi;
#  186|   
#  187|->     grid->r[i - 1] = ri;
#  188|       grid->w[i - 1] = wi;
#  189|       grid->pot_values[i - 1] = params->potential(ri, params->potential_params);

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:187:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(10000, 8)’
#  185|       double ri = -R * ln_xi;
#  186|   
#  187|->     grid->r[i - 1] = ri;
#  188|       grid->w[i - 1] = wi;
#  189|       grid->pot_values[i - 1] = params->potential(ri, params->potential_params);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:188: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  186|   
#  187|       grid->r[i - 1] = ri;
#  188|->     grid->w[i - 1] = wi;
#  189|       grid->pot_values[i - 1] = params->potential(ri, params->potential_params);
#  190|       grid->gto_values[i - 1] = radial_type1_integrand_fun(ri, params);

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:188:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(10000, 8)’
#  186|   
#  187|       grid->r[i - 1] = ri;
#  188|->     grid->w[i - 1] = wi;
#  189|       grid->pot_values[i - 1] = params->potential(ri, params->potential_params);
#  190|       grid->gto_values[i - 1] = radial_type1_integrand_fun(ri, params);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:189: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  187|       grid->r[i - 1] = ri;
#  188|       grid->w[i - 1] = wi;
#  189|->     grid->pot_values[i - 1] = params->potential(ri, params->potential_params);
#  190|       grid->gto_values[i - 1] = radial_type1_integrand_fun(ri, params);
#  191|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:189:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(10000, 8)’
#  187|       grid->r[i - 1] = ri;
#  188|       grid->w[i - 1] = wi;
#  189|->     grid->pot_values[i - 1] = params->potential(ri, params->potential_params);
#  190|       grid->gto_values[i - 1] = radial_type1_integrand_fun(ri, params);
#  191|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:190: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  188|       grid->w[i - 1] = wi;
#  189|       grid->pot_values[i - 1] = params->potential(ri, params->potential_params);
#  190|->     grid->gto_values[i - 1] = radial_type1_integrand_fun(ri, params);
#  191|   
#  192|       for (int lambda = 0; lambda <= lambda_max; lambda++) {

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:190:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(10000, 8)’
#  188|       grid->w[i - 1] = wi;
#  189|       grid->pot_values[i - 1] = params->potential(ri, params->potential_params);
#  190|->     grid->gto_values[i - 1] = radial_type1_integrand_fun(ri, params);
#  191|   
#  192|       for (int lambda = 0; lambda <= lambda_max; lambda++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:193: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  191|   
#  192|       for (int lambda = 0; lambda <= lambda_max; lambda++) {
#  193|->       grid->mod_bessel[lambda][i - 1] =
#  194|             libgrpp_modified_bessel_scaled(lambda, ri * params->k);
#  195|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type1_integral.c:198: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  196|   
#  197|       for (int n = 0; n <= n_max; n++) {
#  198|->       grid->r_N[n][i - 1] = pow(ri, n);
#  199|       }
#  200|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:107: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  105|     radial_type2_table_t *table;
#  106|     table = (radial_type2_table_t *)calloc(1, sizeof(radial_type2_table_t));
#  107|->   table->lambda1_max = lambda1_max;
#  108|     table->lambda2_max = lambda2_max;
#  109|     table->n_max = n_max;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c: scope_hint: In function ‘libgrpp_tabulate_radial_type2_integrals’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:107:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘table’
#  105|     radial_type2_table_t *table;
#  106|     table = (radial_type2_table_t *)calloc(1, sizeof(radial_type2_table_t));
#  107|->   table->lambda1_max = lambda1_max;
#  108|     table->lambda2_max = lambda2_max;
#  109|     table->n_max = n_max;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:108: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  106|     table = (radial_type2_table_t *)calloc(1, sizeof(radial_type2_table_t));
#  107|     table->lambda1_max = lambda1_max;
#  108|->   table->lambda2_max = lambda2_max;
#  109|     table->n_max = n_max;
#  110|     table->radial_integrals = (double *)calloc(

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:109: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  107|     table->lambda1_max = lambda1_max;
#  108|     table->lambda2_max = lambda2_max;
#  109|->   table->n_max = n_max;
#  110|     table->radial_integrals = (double *)calloc(
#  111|         (lambda1_max + 1) * (lambda2_max + 1) * (n_max + 1), sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:110: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: table
#  108|     table->lambda2_max = lambda2_max;
#  109|     table->n_max = n_max;
#  110|->   table->radial_integrals = (double *)calloc(
#  111|         (lambda1_max + 1) * (lambda2_max + 1) * (n_max + 1), sizeof(double));
#  112|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:313: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  311|         (radial_type2_grid_t *)calloc(1, sizeof(radial_type2_grid_t));
#  312|   
#  313|->   grid->nr = MIN_GRID;
#  314|     grid->n_max = n_max;
#  315|     grid->lambda1_max = lambda1_max;

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c: scope_hint: In function ‘create_radial_type2_grid’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:313:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘grid’
#  311|         (radial_type2_grid_t *)calloc(1, sizeof(radial_type2_grid_t));
#  312|   
#  313|->   grid->nr = MIN_GRID;
#  314|     grid->n_max = n_max;
#  315|     grid->lambda1_max = lambda1_max;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:314: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  312|   
#  313|     grid->nr = MIN_GRID;
#  314|->   grid->n_max = n_max;
#  315|     grid->lambda1_max = lambda1_max;
#  316|     grid->lambda2_max = lambda2_max;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:315: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  313|     grid->nr = MIN_GRID;
#  314|     grid->n_max = n_max;
#  315|->   grid->lambda1_max = lambda1_max;
#  316|     grid->lambda2_max = lambda2_max;
#  317|     grid->params = params;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:316: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  314|     grid->n_max = n_max;
#  315|     grid->lambda1_max = lambda1_max;
#  316|->   grid->lambda2_max = lambda2_max;
#  317|     grid->params = params;
#  318|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:317: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  315|     grid->lambda1_max = lambda1_max;
#  316|     grid->lambda2_max = lambda2_max;
#  317|->   grid->params = params;
#  318|   
#  319|     grid->r = alloc_zeros_1d(MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:319: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  317|     grid->params = params;
#  318|   
#  319|->   grid->r = alloc_zeros_1d(MAX_GRID);
#  320|     grid->w = alloc_zeros_1d(MAX_GRID);
#  321|     grid->rpp_values = alloc_zeros_1d(MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:320: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  318|   
#  319|     grid->r = alloc_zeros_1d(MAX_GRID);
#  320|->   grid->w = alloc_zeros_1d(MAX_GRID);
#  321|     grid->rpp_values = alloc_zeros_1d(MAX_GRID);
#  322|     grid->F1 = alloc_zeros_2d(lambda1_max + 1, MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:321: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  319|     grid->r = alloc_zeros_1d(MAX_GRID);
#  320|     grid->w = alloc_zeros_1d(MAX_GRID);
#  321|->   grid->rpp_values = alloc_zeros_1d(MAX_GRID);
#  322|     grid->F1 = alloc_zeros_2d(lambda1_max + 1, MAX_GRID);
#  323|     grid->F2 = alloc_zeros_2d(lambda2_max + 1, MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:322: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  320|     grid->w = alloc_zeros_1d(MAX_GRID);
#  321|     grid->rpp_values = alloc_zeros_1d(MAX_GRID);
#  322|->   grid->F1 = alloc_zeros_2d(lambda1_max + 1, MAX_GRID);
#  323|     grid->F2 = alloc_zeros_2d(lambda2_max + 1, MAX_GRID);
#  324|     grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:323: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  321|     grid->rpp_values = alloc_zeros_1d(MAX_GRID);
#  322|     grid->F1 = alloc_zeros_2d(lambda1_max + 1, MAX_GRID);
#  323|->   grid->F2 = alloc_zeros_2d(lambda2_max + 1, MAX_GRID);
#  324|     grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);
#  325|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:324: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  322|     grid->F1 = alloc_zeros_2d(lambda1_max + 1, MAX_GRID);
#  323|     grid->F2 = alloc_zeros_2d(lambda2_max + 1, MAX_GRID);
#  324|->   grid->r_N = alloc_zeros_2d(n_max + 1, MAX_GRID);
#  325|   
#  326|     // vectors 'k': k = - 2 * alpha * |CA|

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:335: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  333|   
#  334|     // initial set of pre-calculated points
#  335|->   int nr = grid->nr;
#  336|     const double R = 5.0;
#  337|     const double R3 = R * R * R;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:346: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  344|       double ri = -R * ln_xi;
#  345|   
#  346|->     grid->r[i - 1] = ri;
#  347|       grid->w[i - 1] = wi;
#  348|       grid->rpp_values[i - 1] =

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:347: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  345|   
#  346|       grid->r[i - 1] = ri;
#  347|->     grid->w[i - 1] = wi;
#  348|       grid->rpp_values[i - 1] =
#  349|           libgrpp_potential_value(grid->params->potential, ri);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:348: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  346|       grid->r[i - 1] = ri;
#  347|       grid->w[i - 1] = wi;
#  348|->     grid->rpp_values[i - 1] =
#  349|           libgrpp_potential_value(grid->params->potential, ri);
#  350|       for (int n = 0; n <= n_max; n++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:349: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  347|       grid->w[i - 1] = wi;
#  348|       grid->rpp_values[i - 1] =
#  349|->         libgrpp_potential_value(grid->params->potential, ri);
#  350|       for (int n = 0; n <= n_max; n++) {
#  351|         grid->r_N[n][i - 1] = pow(ri, n);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:351: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  349|           libgrpp_potential_value(grid->params->potential, ri);
#  350|       for (int n = 0; n <= n_max; n++) {
#  351|->       grid->r_N[n][i - 1] = pow(ri, n);
#  352|       }
#  353|       for (int lambda1 = 0; lambda1 <= lambda1_max; lambda1++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  352|       }
#  353|       for (int lambda1 = 0; lambda1 <= lambda1_max; lambda1++) {
#  354|->       grid->F1[lambda1][i - 1] = radial_type2_integrand_fun_contracted(
#  355|             ri, lambda1, bra_k, params->CA, params->bra);
#  356|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_radial_type2_integral.c:358: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: grid
#  356|       }
#  357|       for (int lambda2 = 0; lambda2 <= lambda2_max; lambda2++) {
#  358|->       grid->F2[lambda2][i - 1] = radial_type2_integrand_fun_contracted(
#  359|             ri, lambda2, ket_k, params->CB, params->ket);
#  360|       }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:36: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   34|     libgrpp_shell_t *shell = (libgrpp_shell_t *)malloc(sizeof(libgrpp_shell_t));
#   35|   
#   36|->   shell->L = L;
#   37|     shell->origin[0] = origin[0];
#   38|     shell->origin[1] = origin[1];

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c: scope_hint: In function ‘libgrpp_new_shell’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:36:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘shell’
#   34|     libgrpp_shell_t *shell = (libgrpp_shell_t *)malloc(sizeof(libgrpp_shell_t));
#   35|   
#   36|->   shell->L = L;
#   37|     shell->origin[0] = origin[0];
#   38|     shell->origin[1] = origin[1];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:37: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   35|   
#   36|     shell->L = L;
#   37|->   shell->origin[0] = origin[0];
#   38|     shell->origin[1] = origin[1];
#   39|     shell->origin[2] = origin[2];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:38: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   36|     shell->L = L;
#   37|     shell->origin[0] = origin[0];
#   38|->   shell->origin[1] = origin[1];
#   39|     shell->origin[2] = origin[2];
#   40|     shell->cart_size = (L + 1) * (L + 2) / 2;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:39: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   37|     shell->origin[0] = origin[0];
#   38|     shell->origin[1] = origin[1];
#   39|->   shell->origin[2] = origin[2];
#   40|     shell->cart_size = (L + 1) * (L + 2) / 2;
#   41|     shell->cart_list = libgrpp_generate_shell_cartesians(L);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:40: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   38|     shell->origin[1] = origin[1];
#   39|     shell->origin[2] = origin[2];
#   40|->   shell->cart_size = (L + 1) * (L + 2) / 2;
#   41|     shell->cart_list = libgrpp_generate_shell_cartesians(L);
#   42|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:41: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   39|     shell->origin[2] = origin[2];
#   40|     shell->cart_size = (L + 1) * (L + 2) / 2;
#   41|->   shell->cart_list = libgrpp_generate_shell_cartesians(L);
#   42|   
#   43|     shell->num_primitives = num_primitives;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:43: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   41|     shell->cart_list = libgrpp_generate_shell_cartesians(L);
#   42|   
#   43|->   shell->num_primitives = num_primitives;
#   44|     shell->coeffs = (double *)calloc(num_primitives, sizeof(double));
#   45|     shell->alpha = (double *)calloc(num_primitives, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:44: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   42|   
#   43|     shell->num_primitives = num_primitives;
#   44|->   shell->coeffs = (double *)calloc(num_primitives, sizeof(double));
#   45|     shell->alpha = (double *)calloc(num_primitives, sizeof(double));
#   46|     for (int i = 0; i < num_primitives; i++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:45: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   43|     shell->num_primitives = num_primitives;
#   44|     shell->coeffs = (double *)calloc(num_primitives, sizeof(double));
#   45|->   shell->alpha = (double *)calloc(num_primitives, sizeof(double));
#   46|     for (int i = 0; i < num_primitives; i++) {
#   47|       shell->coeffs[i] = coeffs[i];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:47: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   45|     shell->alpha = (double *)calloc(num_primitives, sizeof(double));
#   46|     for (int i = 0; i < num_primitives; i++) {
#   47|->     shell->coeffs[i] = coeffs[i];
#   48|       shell->alpha[i] = alpha[i];
#   49|     }

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:47:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)num_primitives, 8)’
#   45|     shell->alpha = (double *)calloc(num_primitives, sizeof(double));
#   46|     for (int i = 0; i < num_primitives; i++) {
#   47|->     shell->coeffs[i] = coeffs[i];
#   48|       shell->alpha[i] = alpha[i];
#   49|     }

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:48: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: shell
#   46|     for (int i = 0; i < num_primitives; i++) {
#   47|       shell->coeffs[i] = coeffs[i];
#   48|->     shell->alpha[i] = alpha[i];
#   49|     }
#   50|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_shell.c:48:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc((long unsigned int)num_primitives, 8)’
#   46|     for (int i = 0; i < num_primitives; i++) {
#   47|       shell->coeffs[i] = coeffs[i];
#   48|->     shell->alpha[i] = alpha[i];
#   49|     }
#   50|   

Error: CPPCHECK_WARNING (CWE-401):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:65: error[memleakOnRealloc]: Common realloc mistake: 'rsh_coef_tables' nulled but not freed upon failure
#   63|     } else {
#   64|       // expand tables: realloc memory and add tables for the highest L values
#   65|->     rsh_coef_tables = (rsh_coef_table_t **)realloc(
#   66|           rsh_coef_tables, (Lmax + 1) * sizeof(rsh_coef_table_t *));
#   67|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:84: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coef_table
#   82|     rsh_coef_table_t *coef_table =
#   83|         (rsh_coef_table_t *)calloc(1, sizeof(rsh_coef_table_t));
#   84|->   coef_table->n_cart_comb = ncart;
#   85|     coef_table->cartesian_comb = generate_cartesian_combinations(L, &ncart);
#   86|     coef_table->coeffs = (double *)calloc((2 * L + 1) * ncart, sizeof(double));

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c: scope_hint: In function ‘libgrpp_tabulate_real_spherical_harmonic_coeffs’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:84:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘coef_table’
#   82|     rsh_coef_table_t *coef_table =
#   83|         (rsh_coef_table_t *)calloc(1, sizeof(rsh_coef_table_t));
#   84|->   coef_table->n_cart_comb = ncart;
#   85|     coef_table->cartesian_comb = generate_cartesian_combinations(L, &ncart);
#   86|     coef_table->coeffs = (double *)calloc((2 * L + 1) * ncart, sizeof(double));

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:85: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coef_table
#   83|         (rsh_coef_table_t *)calloc(1, sizeof(rsh_coef_table_t));
#   84|     coef_table->n_cart_comb = ncart;
#   85|->   coef_table->cartesian_comb = generate_cartesian_combinations(L, &ncart);
#   86|     coef_table->coeffs = (double *)calloc((2 * L + 1) * ncart, sizeof(double));
#   87|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:86: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coef_table
#   84|     coef_table->n_cart_comb = ncart;
#   85|     coef_table->cartesian_comb = generate_cartesian_combinations(L, &ncart);
#   86|->   coef_table->coeffs = (double *)calloc((2 * L + 1) * ncart, sizeof(double));
#   87|   
#   88|     for (int m = -L; m <= L; m++) {

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:90: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coef_table
#   88|     for (int m = -L; m <= L; m++) {
#   89|       for (int icomb = 0; icomb < ncart; icomb++) {
#   90|->       int lx = coef_table->cartesian_comb[3 * icomb];
#   91|         int ly = coef_table->cartesian_comb[3 * icomb + 1];
#   92|         // int lz = coef_table->cartesian_comb[3 * icomb + 2];

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:90:11: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘generate_cartesian_combinations(L, & ncart) + (long unsigned int)(icomb * 3) * 4’
#   88|     for (int m = -L; m <= L; m++) {
#   89|       for (int icomb = 0; icomb < ncart; icomb++) {
#   90|->       int lx = coef_table->cartesian_comb[3 * icomb];
#   91|         int ly = coef_table->cartesian_comb[3 * icomb + 1];
#   92|         // int lz = coef_table->cartesian_comb[3 * icomb + 2];

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:91: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coef_table
#   89|       for (int icomb = 0; icomb < ncart; icomb++) {
#   90|         int lx = coef_table->cartesian_comb[3 * icomb];
#   91|->       int ly = coef_table->cartesian_comb[3 * icomb + 1];
#   92|         // int lz = coef_table->cartesian_comb[3 * icomb + 2];
#   93|         double u_lm_lx_ly_lz = libgrpp_spherical_to_cartesian_coef(L, m, lx, ly);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:95: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: coef_table
#   93|         double u_lm_lx_ly_lz = libgrpp_spherical_to_cartesian_coef(L, m, lx, ly);
#   94|         int index = (m + L) * ncart + icomb;
#   95|->       coef_table->coeffs[index] = u_lm_lx_ly_lz;
#   96|       }
#   97|     }

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c: scope_hint: In function ‘libgrpp_evaluate_real_spherical_harmonic’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:213:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  211|     double value = 0.0;
#  212|   
#  213|->   int ncart = rsh_coef_l->n_cart_comb;
#  214|     for (int icomb = 0; icomb < ncart; icomb++) {
#  215|       int r = rsh_coef_l->cartesian_comb[3 * icomb];

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c: scope_hint: In function ‘libgrpp_evaluate_real_spherical_harmonics_array’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:267:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  265|     memset(rsh_array, 0, (2 * l + 1) * sizeof(double));
#  266|   
#  267|->   int ncart = rsh_coef_l->n_cart_comb;
#  268|     int *rst_array = rsh_coef_l->cartesian_comb;
#  269|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c: scope_hint: In function ‘generate_cartesian_combinations’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_spherical_harmonics.c:294:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘combinations’
#  292|         for (int k = 0; k <= L; k++) {
#  293|           if (i + j + k == L) {
#  294|->           combinations[3 * n + 0] = i;
#  295|             combinations[3 * n + 1] = j;
#  296|             combinations[3 * n + 2] = k;

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_utils.c:29: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: array
#   27|   
#   28|     for (int i = 0; i < n; i++) {
#   29|->     array[i] = (double *)calloc(m, sizeof(double));
#   30|     }
#   31|   

Error: GCC_ANALYZER_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_utils.c: scope_hint: In function ‘alloc_zeros_2d’
cp2k-0.0.0-build/cp2k-0.0.0/src/grpp/grpp_utils.c:29:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
#   27|   
#   28|     for (int i = 0; i < n; i++) {
#   29|->     array[i] = (double *)calloc(m, sizeof(double));
#   30|     }
#   31|   

Error: GCC_ANALYZER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c: scope_hint: In function ‘open_connect_socket’
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c:115:9: warning[-Wanalyzer-fd-use-without-check]: ‘connect’ on possibly invalid file descriptor ‘sockfd’
#  113|   
#  114|       // connects
#  115|->     if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
#  116|         perror(
#  117|             "Error opening UNIX socket: path unavailable, or already existing");

Error: GCC_ANALYZER_WARNING:
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c: scope_hint: In function ‘open_bind_socket’
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c:185:9: warning[-Wanalyzer-fd-use-without-check]: ‘bind’ on possibly invalid file descriptor ‘sockfd’
#  183|   
#  184|       // binds
#  185|->     if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0) {
#  186|         perror(
#  187|             "Error binding UNIX socket: path unavailable, or already existing");

Error: GCC_ANALYZER_WARNING (CWE-775):
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c: scope_hint: In function ‘listen_socket’
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c:245:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*psockfd’
#  243|   void listen_socket(int *psockfd, int *backlog) {
#  244|   
#  245|->   if (listen(*psockfd, *backlog) < 0) {
#  246|       perror("Error listening socket");
#  247|       exit(-1);

Error: GCC_ANALYZER_WARNING (CWE-775):
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c: scope_hint: In function ‘accept_socket’
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c:258:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*psockfd’
#  256|   void accept_socket(int *psockfd, int *pclientfd) {
#  257|   
#  258|->   int client_fd = accept(*psockfd, NULL, NULL);
#  259|   
#  260|     *pclientfd = client_fd;

Error: GCC_ANALYZER_WARNING (CWE-775):
cp2k-0.0.0-build/cp2k-0.0.0/src/sockets.c:260:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*psockfd’
#  258|     int client_fd = accept(*psockfd, NULL, NULL);
#  259|   
#  260|->   *pclientfd = client_fd;
#  261|   }
#  262|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:30: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   28|     const char *inp_fn = "H2.inp";
#   29|     FILE *f = fopen(inp_fn, "w");
#   30|->   fprintf(f, "&FORCE_EVAL\n");
#   31|     fprintf(f, "  METHOD Quickstep\n");
#   32|     fprintf(f, "  &DFT\n");

Error: GCC_ANALYZER_WARNING (CWE-688):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c: scope_hint: In function ‘main’
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:30:3: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fopen("H2.inp", "w")’ where non-null expected
<built-in>: note: argument 4 of ‘__builtin_fwrite’ must be non-null
#   28|     const char *inp_fn = "H2.inp";
#   29|     FILE *f = fopen(inp_fn, "w");
#   30|->   fprintf(f, "&FORCE_EVAL\n");
#   31|     fprintf(f, "  METHOD Quickstep\n");
#   32|     fprintf(f, "  &DFT\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:31: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   29|     FILE *f = fopen(inp_fn, "w");
#   30|     fprintf(f, "&FORCE_EVAL\n");
#   31|->   fprintf(f, "  METHOD Quickstep\n");
#   32|     fprintf(f, "  &DFT\n");
#   33|     fprintf(f, "    BASIS_SET_FILE_NAME BASIS_SET\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:32: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   30|     fprintf(f, "&FORCE_EVAL\n");
#   31|     fprintf(f, "  METHOD Quickstep\n");
#   32|->   fprintf(f, "  &DFT\n");
#   33|     fprintf(f, "    BASIS_SET_FILE_NAME BASIS_SET\n");
#   34|     fprintf(f, "    POTENTIAL_FILE_NAME POTENTIAL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:33: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   31|     fprintf(f, "  METHOD Quickstep\n");
#   32|     fprintf(f, "  &DFT\n");
#   33|->   fprintf(f, "    BASIS_SET_FILE_NAME BASIS_SET\n");
#   34|     fprintf(f, "    POTENTIAL_FILE_NAME POTENTIAL\n");
#   35|     fprintf(f, "    LSD\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:34: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   32|     fprintf(f, "  &DFT\n");
#   33|     fprintf(f, "    BASIS_SET_FILE_NAME BASIS_SET\n");
#   34|->   fprintf(f, "    POTENTIAL_FILE_NAME POTENTIAL\n");
#   35|     fprintf(f, "    LSD\n");
#   36|     fprintf(f, "    &MGRID\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:35: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   33|     fprintf(f, "    BASIS_SET_FILE_NAME BASIS_SET\n");
#   34|     fprintf(f, "    POTENTIAL_FILE_NAME POTENTIAL\n");
#   35|->   fprintf(f, "    LSD\n");
#   36|     fprintf(f, "    &MGRID\n");
#   37|     fprintf(f, "      CUTOFF 140\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:36: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   34|     fprintf(f, "    POTENTIAL_FILE_NAME POTENTIAL\n");
#   35|     fprintf(f, "    LSD\n");
#   36|->   fprintf(f, "    &MGRID\n");
#   37|     fprintf(f, "      CUTOFF 140\n");
#   38|     fprintf(f, "    &END MGRID\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:37: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   35|     fprintf(f, "    LSD\n");
#   36|     fprintf(f, "    &MGRID\n");
#   37|->   fprintf(f, "      CUTOFF 140\n");
#   38|     fprintf(f, "    &END MGRID\n");
#   39|     fprintf(f, "    &QS\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:38: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   36|     fprintf(f, "    &MGRID\n");
#   37|     fprintf(f, "      CUTOFF 140\n");
#   38|->   fprintf(f, "    &END MGRID\n");
#   39|     fprintf(f, "    &QS\n");
#   40|     fprintf(f, "      EPS_DEFAULT 1.0E-8\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:39: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   37|     fprintf(f, "      CUTOFF 140\n");
#   38|     fprintf(f, "    &END MGRID\n");
#   39|->   fprintf(f, "    &QS\n");
#   40|     fprintf(f, "      EPS_DEFAULT 1.0E-8\n");
#   41|     fprintf(f, "    &END QS\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:40: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   38|     fprintf(f, "    &END MGRID\n");
#   39|     fprintf(f, "    &QS\n");
#   40|->   fprintf(f, "      EPS_DEFAULT 1.0E-8\n");
#   41|     fprintf(f, "    &END QS\n");
#   42|     fprintf(f, "    &SCF\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:41: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   39|     fprintf(f, "    &QS\n");
#   40|     fprintf(f, "      EPS_DEFAULT 1.0E-8\n");
#   41|->   fprintf(f, "    &END QS\n");
#   42|     fprintf(f, "    &SCF\n");
#   43|     fprintf(f, "      EPS_DIIS 0.1\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:42: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   40|     fprintf(f, "      EPS_DEFAULT 1.0E-8\n");
#   41|     fprintf(f, "    &END QS\n");
#   42|->   fprintf(f, "    &SCF\n");
#   43|     fprintf(f, "      EPS_DIIS 0.1\n");
#   44|     fprintf(f, "      EPS_SCF 1.0E-4\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:43: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   41|     fprintf(f, "    &END QS\n");
#   42|     fprintf(f, "    &SCF\n");
#   43|->   fprintf(f, "      EPS_DIIS 0.1\n");
#   44|     fprintf(f, "      EPS_SCF 1.0E-4\n");
#   45|     fprintf(f, "      IGNORE_CONVERGENCE_FAILURE\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:44: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   42|     fprintf(f, "    &SCF\n");
#   43|     fprintf(f, "      EPS_DIIS 0.1\n");
#   44|->   fprintf(f, "      EPS_SCF 1.0E-4\n");
#   45|     fprintf(f, "      IGNORE_CONVERGENCE_FAILURE\n");
#   46|     fprintf(f, "      MAX_DIIS 4\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:45: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   43|     fprintf(f, "      EPS_DIIS 0.1\n");
#   44|     fprintf(f, "      EPS_SCF 1.0E-4\n");
#   45|->   fprintf(f, "      IGNORE_CONVERGENCE_FAILURE\n");
#   46|     fprintf(f, "      MAX_DIIS 4\n");
#   47|     fprintf(f, "      MAX_SCF 3\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:46: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   44|     fprintf(f, "      EPS_SCF 1.0E-4\n");
#   45|     fprintf(f, "      IGNORE_CONVERGENCE_FAILURE\n");
#   46|->   fprintf(f, "      MAX_DIIS 4\n");
#   47|     fprintf(f, "      MAX_SCF 3\n");
#   48|     fprintf(f, "      SCF_GUESS atomic\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:47: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   45|     fprintf(f, "      IGNORE_CONVERGENCE_FAILURE\n");
#   46|     fprintf(f, "      MAX_DIIS 4\n");
#   47|->   fprintf(f, "      MAX_SCF 3\n");
#   48|     fprintf(f, "      SCF_GUESS atomic\n");
#   49|     fprintf(f, "    &END SCF\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:48: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   46|     fprintf(f, "      MAX_DIIS 4\n");
#   47|     fprintf(f, "      MAX_SCF 3\n");
#   48|->   fprintf(f, "      SCF_GUESS atomic\n");
#   49|     fprintf(f, "    &END SCF\n");
#   50|     fprintf(f, "    &XC\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:49: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   47|     fprintf(f, "      MAX_SCF 3\n");
#   48|     fprintf(f, "      SCF_GUESS atomic\n");
#   49|->   fprintf(f, "    &END SCF\n");
#   50|     fprintf(f, "    &XC\n");
#   51|     fprintf(f, "      &XC_FUNCTIONAL Pade\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:50: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   48|     fprintf(f, "      SCF_GUESS atomic\n");
#   49|     fprintf(f, "    &END SCF\n");
#   50|->   fprintf(f, "    &XC\n");
#   51|     fprintf(f, "      &XC_FUNCTIONAL Pade\n");
#   52|     fprintf(f, "      &END XC_FUNCTIONAL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:51: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   49|     fprintf(f, "    &END SCF\n");
#   50|     fprintf(f, "    &XC\n");
#   51|->   fprintf(f, "      &XC_FUNCTIONAL Pade\n");
#   52|     fprintf(f, "      &END XC_FUNCTIONAL\n");
#   53|     fprintf(f, "    &END XC\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:52: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   50|     fprintf(f, "    &XC\n");
#   51|     fprintf(f, "      &XC_FUNCTIONAL Pade\n");
#   52|->   fprintf(f, "      &END XC_FUNCTIONAL\n");
#   53|     fprintf(f, "    &END XC\n");
#   54|     fprintf(f, "  &END DFT\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:53: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   51|     fprintf(f, "      &XC_FUNCTIONAL Pade\n");
#   52|     fprintf(f, "      &END XC_FUNCTIONAL\n");
#   53|->   fprintf(f, "    &END XC\n");
#   54|     fprintf(f, "  &END DFT\n");
#   55|     fprintf(f, "  &SUBSYS\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:54: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   52|     fprintf(f, "      &END XC_FUNCTIONAL\n");
#   53|     fprintf(f, "    &END XC\n");
#   54|->   fprintf(f, "  &END DFT\n");
#   55|     fprintf(f, "  &SUBSYS\n");
#   56|     fprintf(f, "    &CELL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:55: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   53|     fprintf(f, "    &END XC\n");
#   54|     fprintf(f, "  &END DFT\n");
#   55|->   fprintf(f, "  &SUBSYS\n");
#   56|     fprintf(f, "    &CELL\n");
#   57|     fprintf(f, "      ABC 8.0 4.0 4.0\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:56: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   54|     fprintf(f, "  &END DFT\n");
#   55|     fprintf(f, "  &SUBSYS\n");
#   56|->   fprintf(f, "    &CELL\n");
#   57|     fprintf(f, "      ABC 8.0 4.0 4.0\n");
#   58|     fprintf(f, "    &END CELL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:57: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   55|     fprintf(f, "  &SUBSYS\n");
#   56|     fprintf(f, "    &CELL\n");
#   57|->   fprintf(f, "      ABC 8.0 4.0 4.0\n");
#   58|     fprintf(f, "    &END CELL\n");
#   59|     fprintf(f, "    &COORD\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:58: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   56|     fprintf(f, "    &CELL\n");
#   57|     fprintf(f, "      ABC 8.0 4.0 4.0\n");
#   58|->   fprintf(f, "    &END CELL\n");
#   59|     fprintf(f, "    &COORD\n");
#   60|     fprintf(f, "    H     0.000000  0.000000  0.000000\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:59: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   57|     fprintf(f, "      ABC 8.0 4.0 4.0\n");
#   58|     fprintf(f, "    &END CELL\n");
#   59|->   fprintf(f, "    &COORD\n");
#   60|     fprintf(f, "    H     0.000000  0.000000  0.000000\n");
#   61|     fprintf(f, "    H     1.000000  0.000000  0.000000\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:60: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   58|     fprintf(f, "    &END CELL\n");
#   59|     fprintf(f, "    &COORD\n");
#   60|->   fprintf(f, "    H     0.000000  0.000000  0.000000\n");
#   61|     fprintf(f, "    H     1.000000  0.000000  0.000000\n");
#   62|     fprintf(f, "    &END COORD\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:61: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   59|     fprintf(f, "    &COORD\n");
#   60|     fprintf(f, "    H     0.000000  0.000000  0.000000\n");
#   61|->   fprintf(f, "    H     1.000000  0.000000  0.000000\n");
#   62|     fprintf(f, "    &END COORD\n");
#   63|     fprintf(f, "    &KIND H\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:62: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   60|     fprintf(f, "    H     0.000000  0.000000  0.000000\n");
#   61|     fprintf(f, "    H     1.000000  0.000000  0.000000\n");
#   62|->   fprintf(f, "    &END COORD\n");
#   63|     fprintf(f, "    &KIND H\n");
#   64|     fprintf(f, "      BASIS_SET DZV-GTH-PADE\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:63: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   61|     fprintf(f, "    H     1.000000  0.000000  0.000000\n");
#   62|     fprintf(f, "    &END COORD\n");
#   63|->   fprintf(f, "    &KIND H\n");
#   64|     fprintf(f, "      BASIS_SET DZV-GTH-PADE\n");
#   65|     fprintf(f, "      POTENTIAL GTH-PADE-q1\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:64: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   62|     fprintf(f, "    &END COORD\n");
#   63|     fprintf(f, "    &KIND H\n");
#   64|->   fprintf(f, "      BASIS_SET DZV-GTH-PADE\n");
#   65|     fprintf(f, "      POTENTIAL GTH-PADE-q1\n");
#   66|     fprintf(f, "    &END KIND\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:65: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   63|     fprintf(f, "    &KIND H\n");
#   64|     fprintf(f, "      BASIS_SET DZV-GTH-PADE\n");
#   65|->   fprintf(f, "      POTENTIAL GTH-PADE-q1\n");
#   66|     fprintf(f, "    &END KIND\n");
#   67|     fprintf(f, "  &END SUBSYS\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:66: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   64|     fprintf(f, "      BASIS_SET DZV-GTH-PADE\n");
#   65|     fprintf(f, "      POTENTIAL GTH-PADE-q1\n");
#   66|->   fprintf(f, "    &END KIND\n");
#   67|     fprintf(f, "  &END SUBSYS\n");
#   68|     fprintf(f, "&END FORCE_EVAL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:67: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   65|     fprintf(f, "      POTENTIAL GTH-PADE-q1\n");
#   66|     fprintf(f, "    &END KIND\n");
#   67|->   fprintf(f, "  &END SUBSYS\n");
#   68|     fprintf(f, "&END FORCE_EVAL\n");
#   69|     fprintf(f, "&GLOBAL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:68: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   66|     fprintf(f, "    &END KIND\n");
#   67|     fprintf(f, "  &END SUBSYS\n");
#   68|->   fprintf(f, "&END FORCE_EVAL\n");
#   69|     fprintf(f, "&GLOBAL\n");
#   70|     fprintf(f, "  PRINT_LEVEL SILENT\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:69: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   67|     fprintf(f, "  &END SUBSYS\n");
#   68|     fprintf(f, "&END FORCE_EVAL\n");
#   69|->   fprintf(f, "&GLOBAL\n");
#   70|     fprintf(f, "  PRINT_LEVEL SILENT\n");
#   71|     fprintf(f, "  PROJECT libcp2k_unittest_H2\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:70: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   68|     fprintf(f, "&END FORCE_EVAL\n");
#   69|     fprintf(f, "&GLOBAL\n");
#   70|->   fprintf(f, "  PRINT_LEVEL SILENT\n");
#   71|     fprintf(f, "  PROJECT libcp2k_unittest_H2\n");
#   72|     fprintf(f, "&END GLOBAL\n");

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:71: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   69|     fprintf(f, "&GLOBAL\n");
#   70|     fprintf(f, "  PRINT_LEVEL SILENT\n");
#   71|->   fprintf(f, "  PROJECT libcp2k_unittest_H2\n");
#   72|     fprintf(f, "&END GLOBAL\n");
#   73|     fclose(f);

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:72: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   70|     fprintf(f, "  PRINT_LEVEL SILENT\n");
#   71|     fprintf(f, "  PROJECT libcp2k_unittest_H2\n");
#   72|->   fprintf(f, "&END GLOBAL\n");
#   73|     fclose(f);
#   74|   

Error: CPPCHECK_WARNING (CWE-476):
cp2k-0.0.0-build/cp2k-0.0.0/src/start/libcp2k_unittest.c:73: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#   71|     fprintf(f, "  PROJECT libcp2k_unittest_H2\n");
#   72|     fprintf(f, "&END GLOBAL\n");
#   73|->   fclose(f);
#   74|   
#   75|     // use input file to create a force environment
