~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/common/BackTrace.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
    size_t sz = 1024; // just a guess, template names will go much wider
24
24
    char *function = (char *)malloc(sz);
 
25
    if (!function)
 
26
      return;
25
27
    char *begin = 0, *end = 0;
26
28
    
27
29
    // find the parentheses and address offset surrounding the mangled name
34
36
    if (begin && end) {
35
37
      int len = end - begin;
36
38
      char *foo = (char *)malloc(len+1);
 
39
      if (!foo)
 
40
        return;
37
41
      memcpy(foo, begin, len);
38
42
      foo[len] = 0;
39
43