<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - False positive on strsep function call"
href="http://llvm.org/bugs/show_bug.cgi?id=15374">15374</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>False positive on strsep function call
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>kremenek@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jeremy.hustache-mathieu@netasq.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>We implement the following use case of strsep() function:
char *my_function(const char *conf)
{
char *cert, *ca;
if (conf == NULL)
return NULL;
cert = strdup(conf);
if (cert == NULL)
return NULL;
ca = strsep(&cert, g_sep);
6 ← Memory is never released; potential leak of memory pointed to by 'cert'
if (cert == NULL)
{
free(ca);
return NULL;
}
...
free(ca);
return (cert);
}
We have a false positive alert after the call of strsep(). The memory pointed
by cert (which is pointed also by ca) is well-released.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>