Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the clang static analyser turns up an issue with unintialised… #40

Merged
merged 1 commit into from
Jan 20, 2016

Conversation

AidanDelaney
Copy link
Contributor

… pointer in alignment-file.c

  • fixed uninitialised memory
  • used faster memset, rather than an initialisation loop.

The clang analyser reports the following, which have now been addressed. I'm hoping to run some other analysers over the next few days.

$ scan-build gcc -c src/*.c -I .
scan-build: Using '/usr/bin/clang' for static analysis
src/alignment-file.c:126:15: warning: Potential leak of memory pointed to by 'first_sequence'
for(i = 0; i < length_of_genome; i++)
^
src/alignment-file.c:134:10: warning: Dereference of undefined pointer value
if(first_sequence[i] == 'N' && !is_unknown(seq->seq.s[i]))
^~~~~~~~~~~~~~~~~
src/alignment-file.c:160:10: warning: Dereference of undefined pointer value
if(first_sequence[i] == '>')
^~~~~~~~~~~~~~~~~
src/alignment-file.c:166:3: warning: Function call argument is an uninitialized value
free(first_sequence);
^~~~~~~~~~~~~~~~~~~~
4 warnings generated.
scan-build: 4 bugs found.

… pointer in alignment-file.c

  - fixed uninitialised memory
  - used faster memset, rather than an initialisation loop.
andrewjpage added a commit that referenced this pull request Jan 20, 2016
Running the clang static analyser turns up an issue with unintialised…
@andrewjpage andrewjpage merged commit 359f130 into sanger-pathogens:master Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants